Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void draw2D()
- {
- // switch to 2d drawing
- glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- glClearDepth(1);
- glViewport(0,0,800,600);
- glMatrixMode(GL_MODELVIEW);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glOrtho(0, 800, 600, 0, 1, -1);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- // draw your 2d stuff here
- // reset to 3d drawing mode
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(45.0f, 4/3.0f, 0.1f, 1000);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LEQUAL);
- glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement