2016-01-05 07:52:40 +03:00
|
|
|
/*
|
2023-01-09 20:41:41 +03:00
|
|
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
2016-01-05 07:52:40 +03:00
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any damages
|
|
|
|
arising from the use of this software.
|
|
|
|
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it
|
|
|
|
freely.
|
|
|
|
*/
|
|
|
|
|
2022-11-27 07:43:38 +03:00
|
|
|
#include <SDL3/SDL.h>
|
2022-12-15 07:58:20 +03:00
|
|
|
#include <SDL3/SDL_main.h>
|
2023-03-17 02:25:39 +03:00
|
|
|
#include <SDL3/SDL_test.h>
|
2016-01-05 07:52:40 +03:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
2023-01-30 00:30:55 +03:00
|
|
|
SDL_DisplayID *displays;
|
|
|
|
int i;
|
2023-03-17 02:25:39 +03:00
|
|
|
SDLTest_CommonState *state;
|
|
|
|
|
|
|
|
/* Initialize test framework */
|
|
|
|
state = SDLTest_CommonCreateState(argv, 0);
|
2023-11-10 00:29:15 +03:00
|
|
|
if (!state) {
|
2023-03-17 02:25:39 +03:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Parse commandline */
|
|
|
|
if (!SDLTest_CommonDefaultArgs(state, argc, argv)) {
|
|
|
|
return 1;
|
|
|
|
}
|
2016-01-05 07:52:40 +03:00
|
|
|
|
|
|
|
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
|
|
|
|
SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError());
|
2016-04-14 22:10:08 +03:00
|
|
|
return 1;
|
2016-01-05 07:52:40 +03:00
|
|
|
}
|
|
|
|
|
2023-01-30 00:30:55 +03:00
|
|
|
displays = SDL_GetDisplays(NULL);
|
|
|
|
if (displays) {
|
|
|
|
for (i = 0; displays[i]; i++) {
|
|
|
|
SDL_Rect bounds = { -1, -1, -1, -1 }, usable = { -1, -1, -1, -1 };
|
|
|
|
SDL_GetDisplayBounds(displays[i], &bounds);
|
|
|
|
SDL_GetDisplayUsableBounds(displays[i], &usable);
|
|
|
|
SDL_Log("Display #%d ('%s'): bounds={(%d,%d),%dx%d}, usable={(%d,%d),%dx%d}",
|
|
|
|
i, SDL_GetDisplayName(displays[i]),
|
|
|
|
bounds.x, bounds.y, bounds.w, bounds.h,
|
|
|
|
usable.x, usable.y, usable.w, usable.h);
|
|
|
|
}
|
|
|
|
SDL_free(displays);
|
2016-01-05 07:52:40 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
SDL_Quit();
|
2023-03-17 02:25:39 +03:00
|
|
|
SDLTest_CommonDestroyState(state);
|
2016-01-05 07:52:40 +03:00
|
|
|
return 0;
|
|
|
|
}
|