SDL  2.0
testbounds.c File Reference
#include "SDL.h"
+ Include dependency graph for testbounds.c:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 15 of file testbounds.c.

References SDL_Rect::h, i, SDL_GetDisplayBounds, SDL_GetDisplayName, SDL_GetDisplayUsableBounds, SDL_GetError, SDL_GetNumVideoDisplays, SDL_Init, SDL_INIT_VIDEO, SDL_Log, SDL_Quit, SDL_Rect::w, SDL_Rect::x, and SDL_Rect::y.

{
int total, i;
SDL_Log("SDL_Init(SDL_INIT_VIDEO) failed: %s", SDL_GetError());
return 1;
}
for (i = 0; i < total; i++) {
SDL_Rect bounds = { -1,-1,-1,-1 }, usable = { -1,-1,-1,-1 };
SDL_GetDisplayBounds(i, &bounds);
SDL_Log("Display #%d ('%s'): bounds={(%d,%d),%dx%d}, usable={(%d,%d),%dx%d}",
bounds.x, bounds.y, bounds.w, bounds.h,
usable.x, usable.y, usable.w, usable.h);
}
return 0;
}