Jump to content
  • Advertisement
Sign in to follow this  
Bousso

OpenGL Can't paint in OpenGl window

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

I have succeded creating an openGl window with the lesson 1 in the tutorial of Ne He but i can't draw any triangle in it . I have written the code for painting but i don't see any paint in the window I need help

Share this post


Link to post
Share on other sites
Advertisement
[smile]

Make sure you are
a) Clearing the color buffer
b) Swapping your framebuffers

You could post your code if you want more direct help.

Share this post


Link to post
Share on other sites
check your glTranslatef() function, perhaps your z value is too far, should be something like

glTranslatef(0.0f, 0.0f, -5.0f);

Also your coordinates could be off. This will draw a triangle

glBegin(GL_TRIANGLES);
glVertex3f(-1.0f, -1.0f, 0.0f);
glVertex3f(1.0f, -1.0f, 0.0f);
glVertex3f(0.0f, 1.0f, 0.0f);
glEnd();


Share this post


Link to post
Share on other sites
Check your resolution. I was having the same problem and realized that I was using 8-bit color. I switched to 32 and everything worked fine again.

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!