Jump to content
  • Advertisement

Archived

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

TriggerNHappy

Displaying Quads w/ a class

This topic is 5403 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 iam working on a solo project being coded in c++ with the OGL api. Its a tank game. Anyhow Ive got my quad to display outside a class textured and all. But I created a tank class for each individual tank. And I have the same Render code on Tank::Render as i did in the main.cpp. But for some reason it wont display when its called from the class. If anyone could look at the code and tell me whats wrong It would be greatly Appreciated. The Link to where you can get the current source is : www.entruder.com/proj/tank/TanksAlots.zip

Share this post


Link to post
Share on other sites
Advertisement
1) use another clear color. try glClearColor( 0.2f, 0.2f, 0.2f, 1.0f ); for example. this makes "debugging" easier.
you will see that your little quad is there and it''s crying for help!

2) enable your face culling again.

3) comment out the glBlend() command

4) you draw your quad clockwise, but in your InitGL() func
you told GL that your front faces are being drawn counter-clockwise. so, if you keep your winding, change the order of your quad vertices.

do:
glVertex3f( -1.0f, 1.0f, 0.0f );
glVertex3f( -1.0f, -1.0f, 0.0f );
glVertex3f( 1.0f, -1.0f, 0.0f );
glVertex3f( 1.0f, 1.0f, 0.0f );

instead of:
glVertex3f( -1.0f, 1.0f, 0.0f );
glVertex3f( 1.0f, 1.0f, 0.0f );
glVertex3f( 1.0f, -1.0f, 0.0f );
glVertex3f( -1.0f, -1.0f, 0.0f );

voila! there''s your textured quad
hope this help.

the byte doctor

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!