Sign in to follow this  
Bousso

OpenGL Can't paint in OpenGl window

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
[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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this