PDA

View Full Version : OpenGL extension for bitmaps



ksanim
09-04-2001, 11:57 AM
Since I started programming in OpenGL, I've been converting bitmap files into a format that's compatible with OpenGL.

I was wondering what the OpenGL extension is that allows you to use Windows Bitmap files without converting them into another format. I would also appreciate any examples, since I'm not familiar with how extensions work.

Thanks.

Michael Steinberg
09-04-2001, 12:05 PM
I wouldn't know of any extension which would do that (at least if you have 24-bits bmp, you can use GL_BGR_EXT). You can however use the DIB functions to get a compatible format.
I do paletted textures by hand...

Michael Steinberg
09-04-2001, 12:06 PM
Of course, by hand, means that the loading routine converts it! http://www.opengl.org/discussion_boards/ubb/smile.gif

09-04-2001, 09:30 PM
glaux has a bitmap handling util
#include <GL/glaux.h>
....


AUX_RGBImageRec *Image = NULL;
Image=auxDIBImageLoad(file);
...
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, Image->sizeX, Image->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, Image->data);

works for me and remember to add the glaux.lib if your using vc++. I'm not sure if the glaux is windows specific, don't think it is but not sure. Don't know the limitation of auxDIBImageLoad either, it's been working fine for me so far. Only been using 24bit images though.