make fonts right side up.
authorDerek Foreman <manmower@gmail.com>
Mon, 2 Jun 2003 02:20:06 +0000 (02:20 +0000)
committerDerek Foreman <manmower@gmail.com>
Mon, 2 Jun 2003 02:20:06 +0000 (02:20 +0000)
render2/instance.c
render2/paint.c

index 3ffc544ddcd2ec40dbb1eaee4e25997f23890983..311a86e0186a9a23a99d7fac642335ea3a377ec7 100644 (file)
@@ -111,6 +111,13 @@ struct RrInstance *RrInstanceNew(Display *display, int screen)
         glEnable(GL_BLEND);
         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
+        glMatrixMode(GL_PROJECTION);
+        glLoadIdentity();
+        glOrtho(0, RrScreenWidth(inst), 0, RrScreenHeight(inst), 0, 10);
+
+        glMatrixMode(GL_MODELVIEW);
+        glLoadIdentity();
+
         return inst;
     }
 
index 7b8730ea5e74222880fac0cb8b27d942282f653f..ea478cb47c4911a9cb6e6f2ac7a034e3906c6159 100644 (file)
@@ -65,16 +65,20 @@ void RrPaint(struct RrSurface *sur)
     ok = glXMakeCurrent(RrDisplay(inst), RrSurfaceWindow(sur),RrContext(inst));
     assert(ok);
 
-    glMatrixMode(GL_MODELVIEW);
-    glLoadIdentity();
+    glViewport(0, 0, RrScreenWidth(inst), RrScreenHeight(inst));
+/*
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
-
-    glOrtho(0, RrScreenWidth(inst), RrScreenHeight(inst), 0, 0, 10);
-    glViewport(0, 0, RrScreenWidth(inst), RrScreenHeight(inst));
+    glOrtho(RrSurfaceX(sur), RrSurfaceX(sur) + RrSurfaceWidth(sur),
+            RrSurfaceY(sur), RrSurfaceY(sur) + RrSurfaceHeight(sur),
+            0, 10);
     glMatrixMode(GL_MODELVIEW);
+    glViewport(0, 0, RrSurfaceWidth(sur), RrSurfaceHeight(sur));
+*/
+
+    glPushMatrix();
     glTranslatef(-RrSurfaceX(sur),
-                 RrScreenHeight(inst)-RrSurfaceHeight(sur)-RrSurfaceY(sur), 0);
+                 -RrSurfaceY(sur), 0);
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
     p = sur;
@@ -96,6 +100,8 @@ void RrPaint(struct RrSurface *sur)
         break;
     }
 
+    glPopMatrix();
+
     for (i = 0; i < sur->ntextures; ++i)
         RrTexturePaint(sur, &sur->texture[i]);