Determine player's video's color depth

I have just found out what’s slowing down the the graphics in a game i’m making - setting the viedo to 32 bits per pixel, whereas my video can only support up to 24 bits per pixel. You might think this is stupid of me not realizing this sooner, but i’m a newbie and was just following the tutorial verbatim. So anyway after setting it to 24 bits, my game performed really well. My question now is how can I determine the appropriate bits per pixel to set for the other people who would play my game. Is there a way to determine (dynamically) the video settings of other people’s machines.

Thanks in advance,
Rico---------------------------------------------------------------------------
http://drac-cardlib.sourceforge.net


Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

I don’t think there is a way to do that. What I do is open the window and
specify ‘0’ for the depth, which means open at the current depth. Then,
you adjust your colors for that depth, which can be read from the nely
created SDL surface.

So if your game is palette-based, there should be provisions made for
8/15/16/24/32 bit color. Some of these may be the same (15/16), or some
may be unnecessary to test for (8), but the only practical way to do it
is (1) restrict your game to a specific depth, or (2) accommodate all of
them.

SteveOn November 10, 2003 01:21 pm, Rico “Zu?iga” wrote:

I have just found out what’s slowing down the the graphics in a game
i’m making - setting the viedo to 32 bits per pixel, whereas my video
can only support up to 24 bits per pixel. You might think this is
stupid of me not realizing this sooner, but i’m a newbie and was just
following the tutorial verbatim. So anyway after setting it to 24 bits,
my game performed really well. My question now is how can I determine
the appropriate bits per pixel to set for the other people who would
play my game. Is there a way to determine (dynamically) the video
settings of other people’s machines.

I have just found out what’s slowing down the the graphics in a game
i’m making - setting the viedo to 32 bits per pixel, whereas my video
can only support up to 24 bits per pixel. You might think this is
stupid of me not realizing this sooner, but i’m a newbie and was just
following the tutorial verbatim. So anyway after setting it to 24
bits, my game performed really well. My question now is how can I
determine the appropriate bits per pixel to set for the other people
who would play my game. Is there a way to determine (dynamically) the
video settings of other people’s machines.

Thanks in advance,
Rico

Yes, of course, SDL has several function designed to let the programmer
determine which video modes are supported on a computer. Take a look at
SDL_GetVideoInfo() http://sdldoc.csn.ul.ie/sdlgetvideoinfo.php
SDL_ListModes() http://sdldoc.csn.ul.ie/sdllistmodes.php
SDL_VideoModeOK() http://sdldoc.csn.ul.ie/sdlvideomodeok.php

If you are newbie it will be well worth your time to read through the
video section of the SDL documentation at
http://sdldoc.csn.ul.ie/video.php. In fact, reading all the
documentation at http://sdldoc.csn.ul.ie/ takes very little time and can
save you a great deal of time. Although there are a few minor errors in
the documentation, it is always there and more reliably accurate than
asking the people on this list.

		Bob PendletonOn Mon, 2003-11-10 at 10:51, Rico Zu?iga wrote:

http://drac-cardlib.sourceforge.net


Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard

±--------------------------------------+

Rico Zu?iga wrote:

I have just found out what’s slowing down the the graphics in a game i’m making - setting the viedo to 32 bits per pixel, whereas my video can only support up to 24 bits per pixel. You might think this is stupid of me not realizing this sooner, but i’m a newbie and was just following the tutorial verbatim. So anyway after setting it to 24 bits, my game performed really well. My question now is how can I determine the appropriate bits per pixel to set for the other people who would play my game. Is there a way to determine (dynamically) the video settings of other people’s machines.

My experience tells me that there’s no need to. Just make sure you use
SDL_DisplayFormat() for your graphics, and it will run great.

Try setting video back to 32bit, and just use SDL_DisplayFormat() on all
your graphics to see the difference…

HTH–
Milan Babuskov
http://njam.sourceforge.net