Jump to content

  • Log In with Google      Sign In   
  • Create Account


glOrtho() ???


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Metus   Members   -  Reputation: 168

Like
Likes
Like

Posted 25 October 2001 - 05:25 AM

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!

Sponsor:

#2 phueppl1   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 October 2001 - 05:32 AM

You can always write directly to the OGL buffer, but it''s slow as hell.... only good way is to use textured squares.....

cya,
Phil


Visit Rarebyte!
and no!, there are NO kangaroos in Austria (I got this questions a few times over in the states )


#3 Mayrel   Members   -  Reputation: 348

Like
Likes
Like

Posted 25 October 2001 - 05:35 AM

I think you should do something like:

  
// 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.

glPopMatrix();


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.


Uuuuuulrika-ka-ka-ka-ka-ka




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS