I am a beginner with OpenGl programming and am trying to learn how to use Index color mode in OpenGl. Could somebody please give me a link to some good source from where i can learn how to use color index mode?


Also, I make console applications for windows programming and not win32 APIs and so I use GLUT for handling windows functions…

Color index mode is very old, I would not advise trying to use it on modern hardware.

What are your needs exactly ?

I though it was unsupported on all modern cards since GF series or so?

Indeed, color index mode is only supported up till the Geforce FX series.

thanks for the replies…I wanted to use the color index mode only to understand the concept of it and how to use it…my system has the most recent graphics card GeForce Fx 8800…so I guess that is the reason why it is not working on my system…

So going by the same logic,does enabling or disabling the dithering too has no effect with the high 24/32 bit display mode?

u can use a texture to emualte color index eg a 256x1 sized texture + then use glTexCoord2f( X / 255.0 ); to look up the color index X = 0->255 use GL_NEAREST filtering

dithering makes a difference in 16bit color but i cant see a difference with 24bit, it should be turned off anyways (default state is on) cause IIRC theres a performance cost by having it enabled

The GF8800 is not a FX. The problem of emulation the indexed mode is that only the nearest filter would work with 2 texture lookups. A bilenear filtered sample need 8 lookups and many shader instructions.
In most cases the DXT1 texture compression gives a better result than the indexed mode.

thanks…i will be reading texture after lighting this week and i guess then i will be able to comprehend the above solutions in a better way to using glIndex…

Just drop glIndex and don’t waste your time with it. There’s plenty of other stuff you need to learn, don’t worry.