[SDL] Determine player's video's color depth...

Bob Pendleton bob at pendleton.com
Mon Nov 10 12:38:00 PST 2003

On Mon, 2003-11-10 at 10:51, 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.
> 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 Pendleton

> ---------------------------------------------------------------------------
> http://drac-cardlib.sourceforge.net
> ______________________________________________________________________
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
+ Bob Pendleton: writer and programmer. +
+ email: Bob at Pendleton.com              +
+ web:   www.GameProgrammer.com         +

More information about the SDL mailing list