Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


glu

Member Since 11 Sep 2011
Offline Last Active Apr 30 2013 04:11 PM

Posts I've Made

In Topic: OpenGL Change Window Drawing Size

31 March 2013 - 11:38 AM

 

It sounds like you're forgetting to call glLoadIdentity before your gluOrtho2D.  Also make sure that you've got glMatrixMode (GL_PROJECTION) before both, and also identity in modelview.  Full code:
 

glMatrixMode (GL_PROJECTION);glLoadIdentity ();gluOrtho2D (0, 800, 600, 0);glMatrixMode (GL_MODELVIEW);glLoadIdentity ();
 
This is needed because gluOrtho2D is documented as being equivalent to glOrtho with near -1 and far 1, and glOrtho multiples the current matrix by the generated ortho matrix; it doesn't replace it.
 

Wow, THANK YOU. I have actually posted this same thread twice on stackoverflow, and once on the OpenGL discussion boards, and no one has replied with anything useful. Thanks, your the first person to actually help me with this, and it works with no problems now.

PARTNERS