Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Dunge

glColor3f();

This topic is 6388 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

int DrawGLScene(GLvoid) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslatef( 0.0f, 0.0f,-5.0f); GLfloat sceneroty = 360.0f - yrot; glRotatef(sceneroty,0,1.0f,0); glTranslatef( xpos,-2.0f, zpos); glBindTexture(GL_TEXTURE_2D, texture[0]); glBegin(GL_QUADS); glTexCoord2f(10.0f, 10.0f); glVertex3f(-25.0f, 0.0f,-50.0f); glTexCoord2f(0.0f, 10.0f); glVertex3f( 25.0f, 0.0f,-50.0f); glTexCoord2f(0.0f, 0.0f); glVertex3f( 25.0f, 0.0f, 0.0f); glTexCoord2f(10.0f, 0.0f); glVertex3f(-25.0f, 0.0f, 0.0f); glEnd(); glLoadIdentity(); glTranslatef( 0.0f, jumppos,-5.0f); glColor3f(0.0f,1.0f,0.0f); glBegin(GL_QUADS); glVertex3f(-0.2f, 1.0f, 0.0f); glVertex3f( 0.2f, 1.0f, 0.0f); glVertex3f( 0.2f, 0.0f, 0.0f); glVertex3f(-0.2f, 0.0f, 0.0f); glEnd(); if (!braking) { xpos += (float)sin(heading*piover180) * 0.1f; zpos += (float)cos(heading*piover180) * 0.1f; } fps = fps + 1.00f; return TRUE; } Here is a bit of my code for my new game.... I don''t understand something, look at the line glColor3f(0.0f,1.0f,0.0f); it is doing some weird thing, it put the first quad (the textured one) green but not the one under this line... why?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Make sure that you turn texturing off on quads that aren''t going to be textured.

(BTW: This is Null and Void, but I can''t login here )

Share this post


Link to post
Share on other sites
Ok.... well now the second quad is green but the first too... I want the textured one to use the real texture color...

Share this post


Link to post
Share on other sites
glEnable(GL_TEXTURE_2D); before all the textured quads, then after your done with those, disable GL_TEXTURE_2D

Share this post


Link to post
Share on other sites
yeah I did it.... but the textured quads can be colored with glcolor3f too! and I don''t want this! glloadidentity don''t remove this......

Share this post


Link to post
Share on other sites
Oh...... cool it work... I tested with 0.0f before and all was black so I though 1.0f for all will put the texture white.... no it''s ok! thx!

Share this post


Link to post
Share on other sites

  • 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!