I have a textured cube with alpha channels and wish to draw a wireframe box around the cube. The problem I'm running into is that the wireframe does not show through transparent part of the textured cube. How can I show the wireframe in the back?
Here is the code that I'm using to draw both cubes:
glLoadIdentity();
glTranslatef(0.0f, 0.0f, z);
glRotatef(xRotation, 1.0f, 0.0f, 0.0f);
glRotatef(yRotation, 0.0f, 1.0f, 0.0f);
glRotatef(zRotation, 0.0f, 0.0f, 1.0f);
// Draw Textured
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_TEXTURE_2D);
glEnable(GL_LIGHTING);
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glBindTexture(GL_TEXTURE_2D, _images[_filter]);
glBegin(GL_QUADS);
DrawTexturedCube();
glEnd();
// Draw Wireframe
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
glColor3f(1.0f, 0.0f, 0.0f);
glBegin(GL_QUADS);
DrawWireframeCube();
glEnd();
xRotation += xSpeed;
yRotation += ySpeed;
zRotation += zSpeed;
The blend function in my Init is using:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I've tried different alpha values for glColor4f before drawing the textures, but it didn't make a difference.