Advertisement

IPicture (Tranparency with Gif Files)

Started by January 14, 2004 12:12 PM
-1 comments, last by Ructions 21 years, 1 month ago
i am using the Ipicture code from the nehe. but this code only makes black tranparent. i am using gif and want to make the tranparent areas in the gif transparent on the screen but they show up as white on the screen at the moment. // Convert From BGR To RGB Format And Add An Alpha Value Of 255 for(long i = 0; i < lWidthPixels * lHeightPixels; i++) // Loop Through All Of The Pixels { BYTE* pPixel = (BYTE*)(&pBits); BYTE temp = pPixel[0]; pPixel[0] = pPixel[2]; pPixel[2] = temp; if ((pPixel[0]==0) && (pPixel[1]==0) && (pPixel[2]==0)) pPixel[3] = 0; else pPixel[3] = 255; i have this in the initGL function glAlphaFunc(GL_GREATER,0.1f); glEnable(GL_ALPHA_TEST); i was wondering how do i set it up so that the transparency to be transparent and not the black be transparent. I was also wondering what the #include <olectl.h> header file is and whats its use. Hopefully this makes sence. i am a newbie to opengl

This topic is closed to new replies.

Advertisement