Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


gluOrtho2d setup code

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

Hi there, A question about the gluOrtho2d function... I have this 2d orthogonal opengl window rendering a grid. I want to zoom in/out of this grid using +/- keys and move the camera around using the mouse. I''ve got all this working correctly now but I''m wondering if i''m using the correct approach. Each time I move the mouse or press +/- I use gluOrtho2d to setup the view again according to the users input. This means I use gluOrtho2d in the mousemove event and in the keypress events. The Redbook almost always only uses gluOrtho2d in the reshape (resize) events so I''m wondering if my approach is correct. It does exactly what I want it to do (it zooms in/out and moves the camera perfectly) but is this a good method or should I only use the gluOrtho2d in the reshape function? later Jayce

Share this post

Link to post
Share on other sites
If it works there isn''t any problem with what you are doing.

The fanatic is incorruptible: if he kills for an idea, he can just as well get himself killed for one; in either case, tyrant or martyr, he is a monster.
--EM Cioran

Opere Citato

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!