summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/util/idproj.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/util/idproj.c')
-rw-r--r--xc/extras/Mesa/util/idproj.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/xc/extras/Mesa/util/idproj.c b/xc/extras/Mesa/util/idproj.c
new file mode 100644
index 000000000..d5ee3409f
--- /dev/null
+++ b/xc/extras/Mesa/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();
+}
+