World of Rigid Bodies (WoRB)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
WoRB::GLOrthoScreen Class Reference

Establishes temporarily orthogonal projection in screen coordinates. More...

#include <Utilities.h>

Public Member Functions

 GLOrthoScreen ()
 Constructor; saves the current and establishes a new transformation.
 ~GLOrthoScreen ()
 Destructor; restores the earlier transformation.

Detailed Description

Establishes temporarily orthogonal projection in screen coordinates.

Definition at line 251 of file Utilities.h.


Constructor & Destructor Documentation

Constructor; saves the current and establishes a new transformation.

Definition at line 256 of file Utilities.h.

        {
            glDisable( GL_DEPTH_TEST );

            // Temporarily set up the view in orthographic projection.
            //
            glMatrixMode( GL_PROJECTION );

            glPushMatrix ();
            glLoadIdentity ();
            glOrtho( /* left   */  0.0, /* right */ glutGet( GLUT_WINDOW_WIDTH ), 
                     /* bottom */  0.0, /* top   */ glutGet( GLUT_WINDOW_HEIGHT ), 
                     /* zNear  */ -1.0, /* zFar  */ 1.0
            );

            glMatrixMode( GL_MODELVIEW );

            glPushMatrix ();
            glLoadIdentity ();
        }

Destructor; restores the earlier transformation.

Definition at line 279 of file Utilities.h.

        {
            // Go back to projection mode
            //
            glPopMatrix ();
            glMatrixMode( GL_PROJECTION );

            glPopMatrix ();
            glMatrixMode( GL_MODELVIEW );

            glEnable( GL_DEPTH_TEST );
        }

The documentation for this class was generated from the following file: