Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jverkoey

transparent loaded bmps?

This topic is 5733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.....
   
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);
		}
	}
}  
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]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!