diff options
author | marha <marha@users.sourceforge.net> | 2009-10-08 13:15:52 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-10-08 13:15:52 +0000 |
commit | a0c4815433ccd57322f4f7703ca35e9ccfa59250 (patch) | |
tree | f5213802ec12adb86ec3136001c1c29fe5343700 /mesalib/progs/util/idproj.c | |
parent | c73dc01b6de45612b24dc2dd34fba24d81ebf46c (diff) | |
download | vcxsrv-a0c4815433ccd57322f4f7703ca35e9ccfa59250.tar.gz vcxsrv-a0c4815433ccd57322f4f7703ca35e9ccfa59250.tar.bz2 vcxsrv-a0c4815433ccd57322f4f7703ca35e9ccfa59250.zip |
Added MesaLib-7.6
Diffstat (limited to 'mesalib/progs/util/idproj.c')
-rw-r--r-- | mesalib/progs/util/idproj.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mesalib/progs/util/idproj.c b/mesalib/progs/util/idproj.c new file mode 100644 index 000000000..d5ee3409f --- /dev/null +++ b/mesalib/progs/util/idproj.c @@ -0,0 +1,26 @@ +/* idproj.c */ + + +/* + * Setup an identity projection such that glVertex(x,y) maps to + * window coordinate (x,y). + * + * Written by Brian Paul and in the public domain. + */ + + + + + +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(); +} + |