• Advertisement
Sign in to follow this  

Problem with 2d Interface [SOLVED]

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

Advertisement
Hi,

Im not 100% about this but maybe try something like:

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(gl->camera_x,gl->camera_y,gl->camera_z);
glRotatef(gl->camera_rotation_x,1,0,0);
glRotatef(gl->camera_rotation_y,0,1,0);
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
Draw3D(global,gl);
Draw2D(global,gl); //perhaps better here?

// If I comment out everything below this point (Except for the SwapBuffers() the code works)

//glMatrixMode(GL_PROJECTION);
//glPushMatrix();
//glLoadIdentity();
//glOrtho(0,1024,768,0,0,1);

//glMatrixMode(GL_MODELVIEW);
//glLoadIdentity();
//glPopMatrix(); //Have you anything pushed onto the stack?

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0,1024,0,768);
glViewport(0, 0, 1024, 768);

SwapBuffers(global->hDC);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement