Need advice - SDL vs. OGL and resizing

Started by
0 comments, last by thedevdan 19 years, 7 months ago
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?
-Todd"Windows dectected that your mouse has moved. Please reboot for the changes to take effect"
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.
Not giving is not stealing.

This topic is closed to new replies.

Advertisement