how can i display a pixmap to the screen using glDrawPixels

Hi, i’m kind of new to opengl. I’m wonder if any can help me on this problem.

first i used the function:
Texture = auxDIBImageLoad(pFilename);

to load an “name.bmp” picture to Texture
then i try to use the Texture data to display directly to the screen with this function:

glRasterPos2i (50,50); // starting point to draw the data
glDrawPixels (Texture->sizeX, Texture->sizeY, GL_RGB, GL_UNSIGNED_BYTE, Texture->data);

The result output did display the picture i created in paint. Can anyone help please

I am not sure what your problem is.

I have my own BMP loader/writer and a testing code to view a BMP using glDrawPixels(). First, take a look at the source code how I did.

If you still have troubles, please post the problem once again.

Thank you so much, it is all clear now thank :slight_smile:
May i ask u a question?
Where do u get all the information of the bmp structure at? is there a possible place i can locate most of the structure of different picture format? Like jpg,png, etc. :slight_smile: has information about many common file formats.

Please learn to use your favorite search engine for common queries like this one. Typing “file formats” into google, for example, lists wotsit first. Persistence and creative search queries can prove fruitful, and can produce information widely and not so widely known to the less illuminated among us.