From 2ac567660c82b8e2f05662989a1001d19c55e672 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Sun, 8 Jun 2003 05:23:15 +0000 Subject: [PATCH] change projection matrix to be .1 off (seems to fix triangles) fix off by ones in matrices --- render2/instance.c | 4 +++- render2/paint.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/render2/instance.c b/render2/instance.c index 66e305af..c21882c6 100644 --- a/render2/instance.c +++ b/render2/instance.c @@ -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(); diff --git a/render2/paint.c b/render2/paint.c index c86a334c..e8ddf5f8 100644 --- a/render2/paint.c +++ b/render2/paint.c @@ -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); -- 2.39.2