void LoadGLTextures()
{
HBITMAP hBMP; // Handle Of The Bitmap
BITMAP BMP; // Bitmap Structure
byte Texture[]={ IDB_FONT, IDB_GRASS, IDB_MARBLE, IDB_SAPWOOD, IDB_SHEETMETAL };
glGenTextures(sizeof(Texture), &texture[0]);
for (int loop=0; loop<sizeof(Texture); loop++)
{
hBMP=(HBITMAP)LoadImage(GetModuleHandle(NULL),MAKEINTRESOURCE(Texture[loop]), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
if (hBMP)
{
GetObject(hBMP,sizeof(BMP), &BMP);
glPixelStorei(GL_UNPACK_ALIGNMENT,4);
glBindTexture(GL_TEXTURE_2D, texture[loop]);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR);
gluBuild2DMipmaps(GL_TEXTURE_2D, 3, BMP.bmWidth, BMP.bmHeight, GL_BGR_EXT, GL_UNSIGNED_BYTE, BMP.bmBits);
DeleteObject(hBMP);
}
}
}
transparent loaded bmps?
I was recently looking at tutorial 38, and I put the code in to my program (it works great, now I don't have to make sure I have all the pics when I'm zipping the file, lol) but the one thing is, before, I had it so that the bmp's could load with transparencies, and now....I don't know how to put the transparencies back in.....
that's the code I am using, down to the point.....and I want to know how to put some more code in there to check for....pink let's say, and then change that to alpha....I tried to do it myself, but i don't know enough about win32 bmp stuff and I couldn't figure out how to convert the Aux_rgb image things or whatever in to BITMAP format.....
-jverkoey
[edited by - jverkoey on February 8, 2003 12:01:16 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement