Original Post
Hi, I know how to make simple image to fade, but I dont understend how to make fade image with mask. Here is my image drawing function: void DrawImage(Image_t Img, float pos_x, float pos_y, float width, float height){ glDisable(GL_LIGHTING); glTranslatef(pos_x,pos_y,-90.0); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_DST_COLOR, GL_ZERO); glBindTexture(GL_TEXTURE_2D, Img.mask); glBegin(GL_QUADS); glTexCoord2f(1.0 , 1.0); glVertex2f(width, height); glTexCoord2f(0.0 , 1.0); glVertex2f(-width, height); glTexCoord2f(0.0, 0.0); glVertex2f(-width, -height); glTexCoord2f(1.0, 0.0); glVertex2f(width, -height); glEnd(); glBlendFunc(GL_ONE, GL_ONE); glBindTexture(GL_TEXTURE_2D, Img.data); glBegin(GL_QUADS); glTexCoord2f(1.0 , 1.0); glVertex2f(width, height); glTexCoord2f(0.0 , 1.0); glVertex2f(-width, height); glTexCoord2f(0.0, 0.0); glVertex2f(-width, -height); glTexCoord2f(1.0, 0.0); glVertex2f(width, -height); glEnd(); glEnable(GL_DEPTH_TEST); glDisable(GL_BLEND); glEnable(GL_LIGHTING); glLoadIdentity(); } and image loading function fragment: for (i=0; i<infoheader.biWidth*infoheader.biHeight; i++) { fread(&rgb,sizeof(rgb),1,l_file); // Here I delete background with color 32,32,32 if (rgb.rgbtRed==32 && rgb.rgbtGreen==32 && rgb.rgbtBlue==32){ l_texture[j+0]=rgb.rgbtRed; l_texture[j+1]=rgb.rgbtGreen; l_texture[j+2]=rgb.rgbtBlue; l_texture[j+3]=0; } else { l_texture[j+0]=rgb.rgbtRed; l_texture[j+1]=rgb.rgbtGreen; l_texture[j+2]=rgb.rgbtBlue; l_texture[j+3]=255; } j+=4; } Can anybody plz tell me how to make my image fade?