Jump to content
  • Advertisement
Sign in to follow this  
toddhd

OpenGL Need advice - SDL vs. OGL and resizing

This topic is 5413 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

When I started out making games, I used SDL exclusively. All the games I made were 2D, and this was a great solution in general. My only big complaint about SDL was that changing screen sizes and resolutions wasn't the easiest thing in terms of making things look right. For example, lets say I created a screen @ 640x480, and setup some menus so that the text was certain size and position and looked good. Then later I decide that the user should be able to switch resolutions. But when the mode switches to 1024x768 or larger, that same text looks teeny, and isn't layed out so efficiently now. When I started to program in OpenGL (in ortho mode, for example), I noticed an amazing thing - OGL is really good at switching resolutions and keeping everything in perspective. The same menus that looked great in 640x480 still look great and proportionate in higher resolutions. And no real extra work was needed on my part. So OpenGL makes as great a 2D engine as it does a 3D engine. Now yes, I know you can kind of mix SDL and OGL. But here is my question - using SDL only (no OGL) is there a good way to maintain the aspect ratio of graphics and text to screen size? Was there something I was missing? Or is it totally dependent on the programmer to account for the sceen resolution and adjust the graphics accordingly?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by toddhd
When I started out making games, I used SDL exclusively. All the games I made were 2D, and this was a great solution in general. My only big complaint about SDL was that changing screen sizes and resolutions wasn't the easiest thing in terms of making things look right. For example, lets say I created a screen @ 640x480, and setup some menus so that the text was certain size and position and looked good. Then later I decide that the user should be able to switch resolutions. But when the mode switches to 1024x768 or larger, that same text looks teeny, and isn't layed out so efficiently now.

When I started to program in OpenGL (in ortho mode, for example), I noticed an amazing thing - OGL is really good at switching resolutions and keeping everything in perspective. The same menus that looked great in 640x480 still look great and proportionate in higher resolutions. And no real extra work was needed on my part. So OpenGL makes as great a 2D engine as it does a 3D engine.

Now yes, I know you can kind of mix SDL and OGL. But here is my question - using SDL only (no OGL) is there a good way to maintain the aspect ratio of graphics and text to screen size? Was there something I was missing? Or is it totally dependent on the programmer to account for the sceen resolution and adjust the graphics accordingly?


SDL only knows about pixel data. You would have to do the resizing yourself.

Yes, that sucks.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!