Advertisement

Bitmaps in Open-GL

Started by November 18, 2000 09:38 AM
2 comments, last by Blue*Omega 24 years, 2 months ago
Could someone kindly point me to an example of how to load a bitmap so it can be rendered with glDrawPixels()? I''m trying to load a bitmap as a background but I''m not getting the loading part right ----------------------------- Blue*Omega (Insert Witty Quote Here)
// Tojiart
You can load an image using auxDIBImageLoad() function. It works for Windows Bitmaps (BMP's). In order to use this function you have to include "gl/glaux.h" file in your project. This is a standard OpenGL header file in VC++. Then all you have to do is as follows

AUX_RGBImageRec *Image;

Image = auxDIBImageLoad(filename);

Now you can draw the image using glDrawPixels()

glDrawPixels(Image->sizeX,Image->sizeY,GL_RGB,GL_UNSIGNED_BYTE,Image->data);

I didn't try it, though. But I think it'll work. So try it.
For more information about this see RedBook or BlueBook. Or you can see NeHe's tutorials on nehe.gamedev.net.



Edited by - QWERTY on November 18, 2000 11:53:39 AM
Advertisement
bitmaps have sort of gone by the wayside in gl your best bet is to use a textured polygon and draw that instead

http://members.xoom.com/myBollux
Hm... I''ll give that a try and see if it works, however, I''ve heard that the aux. library is getting quite outdated. Any other ways? Oh, and zedzeek: I know GL sucks for bitmaps but I don''t want to learn DX and the textured polygon thing just doesn''t work for me.

-----------------------------

Blue*Omega

(Insert Witty Quote Here)
// Tojiart

This topic is closed to new replies.

Advertisement