Jump to content
  • Advertisement
Sign in to follow this  
gargoyle

glColor3f overiding colouring over my texture

This topic is 3265 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey have a drawScene function which draws a textured square but when i call draw_arrow() before or after the code for the texture it covers the whole texture in red. The code for my square is also inside a glPushMatrix() glPopMatrix(). How do I stop the glColor3f(RED) inside my draw_arrow function from colouring over my square? is there a way to disable it or something cos i don't understand why it's doing that.
void draw_arrow(){


glPushMatrix();
glColor3f(5.0f,0.0f,0.0f); //Red Arrow
	glTranslatef(0.0f,0.0f,-5.0f);						//Move into the screen 5 units
	glBegin(GL_QUADS);									
			
												
			glVertex3f(-1.3f, 0.55f,  1.0f);   //Bottom right
												
			glVertex3f( -1.3f, 0.75f,  1.0f);  //Top right
												 
			glVertex3f( -1.7f,  0.75f,  1.0f); //Top left
											
			glVertex3f(-1.7f,  0.55f,  1.0f); //Bottom left
	glEnd();

	glBegin(GL_TRIANGLES);

			glVertex3f(-1.3f, 0.45f,  1.0f);   //Bottom 
												
			glVertex3f( -1.1f, 0.65f,  1.0f);  //Middle
												 
			glVertex3f( -1.3f,  0.85f,  1.0f); //Top 
	glEnd();


glPopMatrix();

}

thanx

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!