SDL: in non-full-screen mode, the maximum window size

I have an application that does not work in full screen. After SDL_init, I execute SDL_SetVideoMode (0, 0, SDL_OPENGL | SDL_HWSURFACE | SDL_ASYNCBLIT). From what I read, this should highlight the maximum size window. Unfortunately, now he selects a window with a size of 1600x900: this is the physical size of the monitor, but not the free space on the monitor (some of them are used in the menu bar and along the border of the window). Any ideas how I can find how much space is available?

+4
source share
1 answer

What is in my program that works in full screen mode (hiding menus, docks, panels, etc.):

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 ().

-2
source

All Articles