View Full Version : Usage of glDrawPixels()

George Neil
06-18-2008, 04:16 AM
Can anyone give me a sample program of how i can make use of glDrawPixels().

06-18-2008, 04:31 AM
Just read the glDrawPixels function spec here (http://www.opengl.org/sdk/docs/man/)

It is very simple, the more complicated is to fill to data array which is out of opengl.

George Neil
06-18-2008, 05:01 AM
How i can make use of OpenGL to do color mapping, given an image and a color look up table ?

06-19-2008, 07:45 AM
You would make a 1D texture.
You also apply a 2D texture to your object which supposidly has the indexing color values.
You need to use shaders. In the fragment shader you sample the textures.

index = float(texture2D(Texture0, gl_TexCoord0.xy));
texel = texture1D(Texture1, index);