Original Post
in my engine, i render all the sprites first, (quads), with lighting enabled; then my drawing components (lines, rectangles, etc), without lighting. I'm drawing a sprite at Z of -1 and a rectangle with Z -5, but when the scene is drawn, the transparent red background (the drawing component quad), is being draw in front of the sprite. here's the code
// loop
glEnable(GL_TEXTURE_2D);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthMask(false);
glEnable(GL_LIGHTING);
EntityManager.Render(m_fTimeElapsed);
ParticleManager.Render(m_fTimeElapsed);
// Disable textures
glDisable(GL_TEXTURE_2D);
glDepthMask(true);
glDisable(GL_LIGHTING);
DrawingManager.Render();
// end loop