I am a new opengl user, I am able to read my image file and display it. But I don’t
see the picture. my images are 8 bit gray level, no color. I would appriciate for the help. I don’t know what I am doing wrong.
1)read image --> bin file
2) clear Display
3) call glDrawPixels(0,0,80,80,GL_float,ptr);
4) if reshape then I do all the projection stuff
it does draw it at the left corner of the screen but all white.
right, you need to debug you code. things you need to check out:
is your raster position valid? If not, why not? Check your modelview matrix, your projection matrix and the parameter to set your raster pos
are you enabling cool features that will mess around with your fragments? Note that if you enable texturing, then the saem texture fragment WILL be applied to EACH pixel of your image, which is probably not what you want. Check your rendering state to make sure you’re not enabling stiff you don’t want. that INCLUDES lighting, of course
is your frame buffer okay? if you have depth buffer set, is your depth buffer cleared
and probably others. its called debugging. Step through your source and checkpoint it. Make sure you know the program is doing what you want it to do at each checkpoint, up until you find a checkpoint which is NOT correct.