From 9381e2fbf7bd1f918c644d13b37034af4a1fd302 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 2 Jun 2003 02:20:06 +0000 Subject: [PATCH] make fonts right side up. --- render2/instance.c | 7 +++++++ render2/paint.c | 18 ++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/render2/instance.c b/render2/instance.c index 3ffc544d..311a86e0 100644 --- a/render2/instance.c +++ b/render2/instance.c @@ -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; } diff --git a/render2/paint.c b/render2/paint.c index 7b8730ea..ea478cb4 100644 --- a/render2/paint.c +++ b/render2/paint.c @@ -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]); -- 2.34.1