Sign in to follow this  

why the resolution of my SDL program is smaller ?

Recommended Posts

nickme    253
i notice that when i open a window in SDL, the resolution is smaller than my monitor's. my monitor's resolution is 1920x1080, but when i open a SDL window with screen width and heigth of 900x500, it cover almost all my screen. can i open a window with the resolution that my monitor is capable? please show me how or explain why not.


Share this post

Link to post
Share on other sites
Wooh    1088
You set the size of the SDL window when you call SDL_SetVideoMode. You can use SDL_GetVideoInfo() to get the monitor resolution.
[code]const SDL_VideoInfo* videoInfo = SDL_GetVideoInfo();
SDL_SetVideoMode(videoInfo->current_w, videoInfo->current_h, 0, SDL_SWSURFACE|SDL_FULLSCREEN|SDL_NOFRAME);[/code]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this