🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.1 KiB

  1. /*
  2. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  3. This software is provided 'as-is', without any express or implied
  4. warranty. In no event will the authors be held liable for any damages
  5. arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it
  8. freely.
  9. */
  10. #include "SDL.h"
  11. int main(int argc, char **argv)
  12. {
  13. int total, i;
  14. if (SDL_Init(SDL_INIT_VIDEO) < 0) {
  15. SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError());
  16. return 1;
  17. }
  18. total = SDL_GetNumVideoDisplays();
  19. for (i = 0; i < total; i++) {
  20. SDL_Rect bounds = { -1,-1,-1,-1 }, usable = { -1,-1,-1,-1 };
  21. SDL_GetDisplayBounds(i, &bounds);
  22. SDL_GetDisplayUsableBounds(i, &usable);
  23. SDL_Log("Display #%d ('%s'): bounds={(%d,%d),%dx%d}, usable={(%d,%d),%dx%d}",
  24. i, SDL_GetDisplayName(i),
  25. bounds.x, bounds.y, bounds.w, bounds.h,
  26. usable.x, usable.y, usable.w, usable.h);
  27. }
  28. SDL_Quit();
  29. return 0;
  30. }
  31. /* vi: set ts=4 sw=4 expandtab: */