• Advertisement
Sign in to follow this  

[SDL] Getting Screen resolution [solved]

This topic is 4134 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
I don't think there have been any significant changes to SDL for years. Either way, a book is rarely going to cover every single thing in the reference docs.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement