Need avdice regarding SDL and switching resolutions

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

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

SDL is a great solution “in general.” I sincerely hope you understand
you “only big complaint about SDL” has nothing to do with SDL. This has
to do with modern video game design.

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.

This is the nature of scalable vector graphics. It is one of the
solutions that had come to mind when I read your first paragraph.

Either that, or you’re texturing everything, and OpenGL is performing
very eye pleasing filtered resizes on all of the imagery in your game’s
UI. You could do this in SDL too without using OpenGL. If this is the
ONLY REASON you’re using OpenGL, I recommend doing the filtering
yourself whenever you load the imagery from the disk.

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?

I guess I got a little ahead of myself (or yourself) in my last
paragraph. The best compromise of a great looking hand-crafted artistic
looking game UI (think the Starcraft interface) and practical creation
time for an amateur developer is to do this:

Have the person responsible for creating the UI art create it at a very
high resolution (an art student would do this naturally, having already
learned why.) Then you have two options: either scale down the images
to preset resolutions and ship them with your game. Or ship the large
versions with your game, and have your game resize them each time the
game loads, and when the display is resized. (A little optimization
there might be to cache the resized imagery on the hard disk so that
the images don’t need to be resized and filtered every time the game
starts up.)

The other option is to use some sort of scalable vector graphics. As I
understand it there is a standard SVG format using XML, but you don’t
necessarily need to know that. I am not very knowledgeable about what
technology has already been to the end of an SVG library, but you’re
free to research that yourself or wait for someone to post it in this
thread in response to me talking about it. Using SVG, your game would
probably load the vector graphics at the beginning of the game, and
rasterize them before using them. Again, you could optimize game load
time by caching the rasterized versions on the hard disk.

Rasterization is (at least) taking a vector graphic like W3C’s SVG
format, or Apple’s ICNS format, or TTF true type fonts, and rendering
them as a flat image. You do this whenever you want to use some vector
graphics at a single scale for a while (like, until the player alters
his game resolution.) This way you don’t need to keep rerendering the
actual vector graphics themselves, but rather just blit their
prerendered rasterization.On Sep 23, 2004, at 12:27 PM, Todd Davis wrote:

Donny Viszneki wrote:

Rasterization is (at least) taking a vector graphic like W3C’s SVG
format, or Apple’s ICNS format, or TTF true type fonts, and rendering
them as a flat image. You do this whenever you want to use some vector
graphics at a single scale for a while (like, until the player alters
his game resolution.) This way you don’t need to keep rerendering the
actual vector graphics themselves, but rather just blit their
prerendered rasterization.

Uh! Good idea. Draw your menus, widgets and whatnot as glyphs (characters) in
a TTF font. Then render them in any desired size. Cool. Can be used for sprite
rotozoom too. Monochrome only, though.–

./lxnt

Can be used for sprite rotozoom too. Monochrome only, though.

Why monochrome?On Sep 24, 2004, at 2:44 AM, Alexander Sabourenkov wrote:

Donny Viszneki wrote:

Can be used for sprite rotozoom too. Monochrome only, though.

Why monochrome?

Seen neither colored TTF fonts nor support for in TTF spec.
I’m not sure, however.> On Sep 24, 2004, at 2:44 AM, Alexander Sabourenkov wrote:

./lxnt

Donny Viszneki wrote:

Can be used for sprite rotozoom too. Monochrome only, though.
Why monochrome?

Seen neither colored TTF fonts nor support for in TTF spec.
I’m not sure, however.

You’re correct. I just didn’t quite understand that you were suggesting
drawing sprites by (somehow) utilizing TTF…

Maybe you could elaborate more?On Sep 24, 2004, at 10:03 AM, Alexander Sabourenkov wrote:

On Sep 24, 2004, at 2:44 AM, Alexander Sabourenkov wrote:

./lxnt


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Donny Viszneki wrote:

Can be used for sprite rotozoom too. Monochrome only, though.

Why monochrome?

Seen neither colored TTF fonts nor support for in TTF spec.
I’m not sure, however.

Is this true? I am sure that I render colored fonts using the SDL_ttf library.

Maybe I am not understanding what you are saying? Maybe you are saying
that the fonts themselves do not have information that specified the
color, but that does not mean that you can not render colored fonts?

ChrisOn Fri, 24 Sep 2004 18:03:07 +0400, Alexander Sabourenkov wrote:

On Sep 24, 2004, at 2:44 AM, Alexander Sabourenkov wrote:


Chris Nystrom
http://www.newio.org/~ccn
AIM: nystromchris

P.S. I have 3 Gmail invites available. Please e-mail me if you want one.

Is this true? I am sure that I render colored fonts using the SDL_ttf
library.

Maybe I am not understanding what you are saying? Maybe you are saying
that the fonts themselves do not have information that specified the
color, but that does not mean that you can not render colored fonts?

When you color your text, you are just applying color to a monochrome
image. He was saying that TTFs don’t inherently have colors in them.On Sep 24, 2004, at 4:44 PM, Chris Nystrom wrote: