I was wondering. Is there a way to get the current screen resolution of the system. I'm working in Linux and if the screen resolution is different than what I set my SDL app to (and set it to fullscreen) it crashes. I'd like to be able to find the system screen resolution and change where things are placed on the screen accordingly.
Thanks!
[Edited by - SigmaX on September 28, 2006 12:28:49 PM]
[SDL] Getting Screen resolution [solved]
Started by SigmaX, Sep 28 2006 03:18 AM
4 replies to this topic
Sponsor:
#2 GDNet+ - Reputation: 949
Posted 28 September 2006 - 03:33 AM
SDL_GetVideoInfo returns a SDL_VideoInfo structure which has .current_w and .current_h which is the current resolution.
#3 Members - Reputation: 226
Posted 28 September 2006 - 03:44 AM
Quote:
Original post by eedok
SDL_GetVideoInfo returns a SDL_VideoInfo structure which has .current_w and .current_h which is the current resolution.
Thanks! That's what I'm looking for (haven't tried it yet, read the description). I hope this is a fairly recent change. I saw that structure in the book "Focus on SDL" and it made no mention of those two members.
-)------ Ed
#5 Members - Reputation: 226
Posted 28 September 2006 - 06:27 AM
Well it looks like the author of the book was using an older version of SDL (or the most current version at the time of pubishing). And it also looks like I'm using the same version. The current_w and current_h where added to the SDL_VideoInfo structure in version 1.2.10. Unfortunatly I'm using glSDL which is stuck at 1.2.9. Thanks for the help. This may be useful in my personal projects.
-)------ Ed






