I have an application that does not run in full-screen mode. After SDL_init I execute SDL_SetVideoMode(0, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_ASYNCBLIT). From what I read, this should allocate a window of maximum size. The unfortunate thing now is that it allocates a window of 1600x900: which is the physical size of the monitor but not the free space on the monitor (some of it is used by the menu-row and by the window-border). Any ideas how I can find how much space is available?
Asked
Active
Viewed 563 times
4
-
Are you looking for a platform specific solution or a general solution? – Xonar Aug 24 '13 at 08:59
1 Answers
-2
What I have in my program that runs fullscreen (hiding menus, docks, panels etc) is:
if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER ) < 0 ) {
throw SDL_GetError();
}
const SDL_VideoInfo* vidinfo = SDL_GetVideoInfo();
int max_w = vidinfo->current_w;
int max_h = vidinfo->current_h;
.
.
.
SDL_Surface *screen = SDL_SetVideoMode(max_w,max_h,0,SDL_FULLSCREEN);
Be sure to call SDL_GetVideoInfo() before SDL_SetVideoMode().

Péter Trombitás
- 39
- 2