change projection matrix to be .1 off (seems to fix triangles)
authorDerek Foreman <manmower@gmail.com>
Sun, 8 Jun 2003 05:23:15 +0000 (05:23 +0000)
committerDerek Foreman <manmower@gmail.com>
Sun, 8 Jun 2003 05:23:15 +0000 (05:23 +0000)
fix off by ones in matrices

render2/instance.c
render2/paint.c

index 66e305af419ac318781f66e8cbc48858b7a83a0a..c21882c6f2673608e99a73dd8bd32e92cddb9a10 100644 (file)
@@ -109,12 +109,14 @@ struct RrInstance *RrInstanceNew(Display *display, int screen)
         inst->surface_map = g_hash_table_new(g_int_hash, g_int_equal);
 
         assert(inst->glx_context);
+        glEnable(GL_CULL_FACE);
         glEnable(GL_BLEND);
         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 
         glMatrixMode(GL_PROJECTION);
         glLoadIdentity();
-        glOrtho(-1, RrScreenWidth(inst), -1, RrScreenHeight(inst), 0, 10);
+        glOrtho(-0.1, RrScreenWidth(inst) - 1.1,
+                -0.1, RrScreenHeight(inst) - 1.1, 0, 10);
 
         glMatrixMode(GL_MODELVIEW);
         glLoadIdentity();
index c86a334cc4f2c48e901afe95458110ad2da505c3..e8ddf5f8bb3c183b60a34e22771476cd1b0c3432 100644 (file)
@@ -84,15 +84,15 @@ void RrPaint(struct RrSurface *sur, int recurse_always)
     ok = glXMakeCurrent(RrDisplay(inst), RrSurfaceWindow(sur),RrContext(inst));
     assert(ok);
 
-    glViewport(0, 0, RrScreenWidth(inst), RrScreenHeight(inst));
+    glViewport(0, 0, RrScreenWidth(inst)-1, RrScreenHeight(inst)-1);
 /*
     glMatrixMode(GL_PROJECTION);
     glLoadIdentity();
-    glOrtho(RrSurfaceX(sur), RrSurfaceX(sur) + RrSurfaceWidth(sur),
-            RrSurfaceY(sur), RrSurfaceY(sur) + RrSurfaceHeight(sur),
+    glOrtho(RrSurfaceX(sur), RrSurfaceX(sur) + RrSurfaceWidth(sur)-1,
+            RrSurfaceY(sur), RrSurfaceY(sur) + RrSurfaceHeight(sur)-1,
             0, 10);
     glMatrixMode(GL_MODELVIEW);
-    glViewport(0, 0, RrSurfaceWidth(sur), RrSurfaceHeight(sur));
+    glViewport(0, 0, RrSurfaceWidth(sur)-1, RrSurfaceHeight(sur)-1);
 */
     glPushMatrix();
     glTranslatef(-RrSurfaceX(sur), -RrSurfaceY(sur), 0);