Sign in to follow this  
SigmaX

[SDL] Getting Screen resolution [solved]

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
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
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

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