Jump to content

  • Log In with Google      Sign In   
  • Create Account

[SDL] Getting Screen resolution [solved]


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 SigmaX   Members   -  Reputation: 317

Like
0Likes
Like

Posted 28 September 2006 - 03:18 AM

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]
-)------ Ed

Sponsor:

#2 eedok   GDNet+   -  Reputation: 971

Like
0Likes
Like

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 SigmaX   Members   -  Reputation: 317

Like
0Likes
Like

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

#4 Kylotan   Moderators   -  Reputation: 3338

Like
0Likes
Like

Posted 28 September 2006 - 04:37 AM

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.

#5 SigmaX   Members   -  Reputation: 317

Like
0Likes
Like

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS