Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Drawing 2D

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

Hello All I am beginner in OpenGL, and I am coding some 2D staff now, I had initialized OpenGL by gluOrtho2D(-10.0f,10.0f,-10.0f,10.0f); Then in my render function I tried the following glLineWidth(3); glBegin(GL_LINES); glColor3f(1.0f,1.0f,0.0f);//Yellow Line glVertex2f(7.0f,3.0f); glVertex2f(5.0f,-3.0f); glColor3f(1.0f,0.0f,0.0f);//Red Line glVertex2f(5.0f,3.0f); glVertex2f(7.0f,-3.0f); glEnd(); And it works fine and I got the 2 lines drawn But for my surprise I got the red yellow line drawn over the red line, which should be in contrast Is there any one have explanation?

Share this post

Link to post
Share on other sites
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!