OpenGL attributes

If I specify the bit depth using SDL_GL_GREEN_SIZE, etc…, do I have to use
SDL_GL_BUFFERSIZE and viceversa?–
Marco Iannaccone @Marco_Iannaccone
ICQ: 18748121 MetalCoder

"What is real? How do you define real? If you’re talking about your
senses, what you feel, taste, smell, or see, then all you’re talking about
are electrical signals interpreted by your brain."
Morpheus - The Matrix

I am in 16 bit colour mode using OpenGL in the docs on the SDL site it
says to use these attributes (as an example). However I thought that
SDL_GL_GREEN_SIZE should be set to 6 not 5. What am I missing here?

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );

Robin.–
Robin Forster, Systems Engineer,
http://www.rsforster.ottawa.on.ca/

RGB565 has the advantage of adding an extra bit to the channel for which
the eye has the greatest dynamic range (green), while RGB555 gives
cleaner color gradients, especially for gray scales. (Every other level
looking slightly greenish looks worse than pure colors with only half as
many levels.)

Anyway, some cards use 555, while others use 565. Some support both. As
usual, don’t expect to get the one you ask for.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Monday 29 October 2001 21:44, Robin Forster wrote:

I am in 16 bit colour mode using OpenGL in the docs on the SDL site it
says to use these attributes (as an example). However I thought that
SDL_GL_GREEN_SIZE should be set to 6 not 5. What am I missing here?

Actually, I’d set R, G, and B to 4. Basically, OpenGL attributes only
guarantee the minimum required result. There are really three common ways
to cram an OpenGL pixel into 16 bits, 4444 (alpha), 555, and 565. There
are also fun things like 5551/1555 and other nonsense to consider, but
they all are accomidated by specifiying 444, asking for at least 12 bit
color. You may well get 24 or even 30 bit (10 bits per channel - though
this is unlikely since most hardware can’t handle it), depending on what
the card and driver feel like giving you.On Mon, Oct 29, 2001 at 03:44:03PM -0500, Robin Forster wrote:

I am in 16 bit colour mode using OpenGL in the docs on the SDL site it
says to use these attributes (as an example). However I thought that
SDL_GL_GREEN_SIZE should be set to 6 not 5. What am I missing here?

SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 5 );
SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );


Joseph Carter Free software developer

  1. there is no 10, but it sounded like a nice number :slight_smile:
    – Wichert Akkerman

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20011030/7cdac830/attachment.pgp