I''m on the stage of implementing a Menu system in my "Sparetime-project".
I''ve planned to have a "Title-screen" menu where the user can choose settings and new game, Thus, simple 2D works perfectly!
Is there any way to just swap to Ortho mode during a function and display a set of bitmaps?
Some src is appreciated!
// Make sure we''re working with the projection matrix.
glMatrixMode(GL_PROJECTION); // Save the current (presumeably perspective) matrix.
glPushMatrix(); glLoadIdentity(); // Set up the orthogonal projection.
glOrtho(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); ... /* Do menu stuff */ // Go back to the previous matrix.
You may have to do something to the modelview matrix, as well. I''m not sure what, since I haven''t tried this yet.
According to the OpenGL standard, you can only be sure of having 2 entries on the projection matrix stack. That means that you couldn''t recursively use glPushMatrix each time you drew a submenu, for example. You''d have to keep track of whether or not you were in a submenu, and not push/pop if it was.