Color Index mode in opengl

When i run my opengl program in Color Index Mode i get the following error:“Glut:Fatal Error:visualities with necessary capabilities not found”.What should i do?

Thanks

[This message has been edited by shobha (edited 03-31-2003).]

Means GLUT hasn’t found a pixelformat which supports the necessary capabilities your app requested.
Check if other display modes support color indexed mode and the other requirements you have in the pixelformat flags.
(On Windows) Microsoft’s GDI generic implementation supports color indexed renderering, most hardware doesn’t (anymore).
Consider color indexed to be outdated.

If want to get color index of any color in RGBA mode, what should i do?

Sorry, your question desn’t make sense.
There is no color index in an RGBA mode.
A color index is an index into a palette containing RGBA values. The index is normally 8 bits, means you can distinguish 256 colors.
RGBA (true color) normally uses 8 bits PER COLOR CHANNEL (4*8 bits) or up to 32 bits per channel (128 bits) in the newest float buffer extensions.

Is your question how to reduce an RGBA true color image to an 8 bit color indexed image?
(This hasn’t much to do with OpenGL then.)
Some keywords to look for algorithms to convert RGBA images to color indexed ones: dithering, Foley, error diffusion, RGB332 palettes, median cut, octree palette reduction.

[This message has been edited by Relic (edited 04-01-2003).]

could i know how to use color palettes in RGBA mode. b’coz i want to use no. to a colour & when ever i want that colour i use that colour number.

[This message has been edited by shobha (edited 04-01-2003).]

You want an indexed-color application within an RGBA environement (typical desktop settings), right?

I am doing a graphics editor in linux using openGL. whenever i want to select a color i should show a palette. when i select a color, i use its color no.