Drawing on top of textured polygon

Hello all,

I am writing a simulated gauge program. I have a textured polygon for the face of the gauge and I am trying to draw the neegle pointer on top of this textured polygon, but it won’t show up. Here is a code snipit.

glLoadIdentity();	
glTranslatef(0.0f, 0.0f, -3.0f);  
glColor3f(1.0,1.0,1.0);
glBindTexture(GL_TEXTURE_2D, texture[0]);
glBegin(GL_QUADS);
    glTexCoord2f(0.0f, 0.0f);  
        glVertex2f(-1.0f, -1.0f);
    glTexCoord2f(1.0f, 0.0f); 
        glVertex2f( 1.0f, -1.0f);
    glTexCoord2f(1.0f, 1.0f); 
        glVertex2f( 1.0f,  1.0f);
        glTexCoord2f(0.0f, 1.0f);
       glVertex2f(-1.0f,  1.0f);
glEnd();

/////////THIS PART WON"T SHOW UP???
glLoadIdentity();
glTranslatef(0.0f, 0.0f, -3.0f);
glColor3f(1,1,1);
glBegin(GL_QUADS);
glVertex2f(-.20,.20);
glVertex2f(.20,-.20);
glVertex2f(-.20,-.20);
glEnd();

Any Help is greatly appreciated. i don’t want to have to texture the needle to have it show up, that seems unecessary.

Jason

A quad is defined by 4 vertices; you’re only sending 3 :stuck_out_tongue:

perhaps you meant glBegin(GL_TRIANGLES).

But what Aeluned said, your two figures have the same z value (-3) and are coplanar. So, you will face z-fighting.

Ok, fixed those errors. The shape now shows up, but it is black, even though I assign white as the color for that quad.

Thanks,

Jason

Ok, figured it out! enable and disable texturing.

Thanks all.

Jason