jtg | afb833d | 1999-08-19 00:55:39 +0000 | [diff] [blame^] | 1 | /* idproj.c */ |
| 2 | |
| 3 | |
| 4 | /* |
| 5 | * Setup an identity projection such that glVertex(x,y) maps to |
| 6 | * window coordinate (x,y). |
| 7 | * |
| 8 | * Written by Brian Paul and in the public domain. |
| 9 | */ |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | void IdentityProjection( GLint x, GLint y, GLsizei width, GLsizei height ) |
| 16 | { |
| 17 | glViewport( x, y, width, height ); |
| 18 | glMatrixMode( GL_PROJECTION ); |
| 19 | glLoadIdentity(); |
| 20 | glOrtho( (GLdouble) x, (GLdouble) y, |
| 21 | (GLdouble) width, (GLdouble) height, |
| 22 | -1.0, 1.0 ); |
| 23 | glMatrixMode( GL_MODELVIEW ); |
| 24 | glLoadIdentity(); |
| 25 | } |
| 26 | |