Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

idproj.c 516B

1234567891011121314151617181920212223242526
  1. /* idproj.c */
  2. /*
  3. * Setup an identity projection such that glVertex(x,y) maps to
  4. * window coordinate (x,y).
  5. *
  6. * Written by Brian Paul and in the public domain.
  7. */
  8. void IdentityProjection( GLint x, GLint y, GLsizei width, GLsizei height )
  9. {
  10. glViewport( x, y, width, height );
  11. glMatrixMode( GL_PROJECTION );
  12. glLoadIdentity();
  13. glOrtho( (GLdouble) x, (GLdouble) y,
  14. (GLdouble) width, (GLdouble) height,
  15. -1.0, 1.0 );
  16. glMatrixMode( GL_MODELVIEW );
  17. glLoadIdentity();
  18. }