Skip to main content
gamedev.net
🔒 Locked

Problem with 2d Interface [SOLVED]

Started by Braden Jan 20, 2006 at 7:46 AM 0 replies 550+ views
Original Post
Braden
Braden
Solved.
Regards,Braden
Cacks
Cacks
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);
Reject the basic asumption of civialisation especially the importance of material possessions

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.