ftp.nice.ch/pub/next/developer/resources/libraries/Mesa.2.0.s.tar.gz#/Mesa-2.0/util/idproj.c

This is idproj.c in view mode; [Download] [Up]

/* idproj.c */


/*
 * Setup an identity projection such that glVertex(x,y) maps to
 * window coordinate (x,y).
 */





void IdentityProjection( GLint x, GLint y, GLsizei width, GLsizei height )
{
   glViewport( x, y, width, height );
   glMatrixMode( GL_PROJECTION );
   glLoadIdentity();
   glOrtho( (GLdouble) x, (GLdouble) y,
            (GLdouble) width, (GLdouble) height,
            -1.0, 1.0 );
   glMatrixMode( GL_MODELVIEW );
   glLoadIdentity();
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.