Screen size and bit depth under OpenGL?

Hi,

How to know what screen size and bits depth are avaible under OpenGL, before
to use:

SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);

Please, show me some examples, because I don’t know what use:

  • SDL_GetVideoInfo(void);
  • SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
  • SDL_VideoModeOK(int width, int height, int bpp, Uint32 flags);
  • SDL_ …

thanks

Laurent (France)_________________________________________________________________
Rejoignez MSN Hotmail, le plus important service de messagerie
http://www.hotmail.com/fr

Hi,

How to know what screen size and bits depth are avaible under OpenGL, before
to use:

SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);

In general SDL_ListModes() will list fullscreen modes that will work
with OpenGL. You can usually specify either 16 or 32 bpp for an OpenGL
video mode, and it’s always safe to use the current depth, as given in
the structure returned by SDL_GetVideoInfo().

See ya!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

What about a cross-platform function to get the available OpenGL buffer
sizes (stencil, auxility, color, depth) for each mode?

RK.

Sam Lantinga wrote:>>Hi,

How to know what screen size and bits depth are avaible under OpenGL, before
to use:

SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);

In general SDL_ListModes() will list fullscreen modes that will work
with OpenGL. You can usually specify either 16 or 32 bpp for an OpenGL
video mode, and it’s always safe to use the current depth, as given in
the structure returned by SDL_GetVideoInfo().

What about a cross-platform function to get the available OpenGL buffer
sizes (stencil, auxility, color, depth) for each mode?

You can’t query them, just set the values you want, set the video mode,
and look at the values you get. The OpenGL drivers will try to provide
the best set of attributes, using your settings as minimums.

I’m don’t think it’s even possible to query them individually for various
video modes.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I mean [glXGetConfig() / DescribePixelFormat()] to query OpenGL stuff
about the mode, and [glXChooseVisual() / ChoosePixelFormat()] to find
the most appropriate mode which best meets requested pixel format
(Accumulator, Depth, Stencil, and Auxility buffer sizes, etc.).

SDL_SetVideoMode() currently handles finding best video mode to meet
requested width, height, bpp, double buffering and stereo(GL), and
SDL_GetVideoMode() handles getting aforementioned info about each of the
modes. In OpenGL there are just a few more things…

RK.

Sam Lantinga wrote:>>What about a cross-platform function to get the available OpenGL buffer

sizes (stencil, auxility, color, depth) for each mode?

You can’t query them, just set the values you want, set the video mode,
and look at the values you get. The OpenGL drivers will try to provide
the best set of attributes, using your settings as minimums

I’m don’t think it’s even possible to query them individually for various
video modes

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment