From d1e22bae522989fe072fb1b9d39e3ff0f37dde77 Mon Sep 17 00:00:00 2001 From: plagman Date: Wed, 30 Sep 2009 00:51:45 +0000 Subject: [PATCH] Polymer screen resizing support. Fixes misaligned crosshair with full HUD. git-svn-id: https://svn.eduke32.com/eduke32@1504 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 89ac35913..ffa5ab00c 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -652,7 +652,7 @@ void polymer_glinit(void) bglClearColor(0.0f, 0.0f, 0.0f, 1.0f); bglClearStencil(0); bglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - bglViewport(0, 0, xdim, ydim); + bglViewport(windowx1, yres-(windowy2+1),windowx2-windowx1+1, windowy2-windowy1+1); // texturing bglEnable(GL_TEXTURE_2D); @@ -672,7 +672,10 @@ void polymer_glinit(void) bglMatrixMode(GL_PROJECTION); bglLoadIdentity(); - bgluPerspective((float)(pr_fov) / (2048.0f / 360.0f), (float)xdim / (float)ydim, 0.01f, 100.0f); + bgluPerspective((float)(pr_fov) / (2048.0f / 360.0f), + (float)(windowx2-windowx1+1) / + (float)(windowy2-windowy1+1), + 0.01f, 100.0f); bglMatrixMode(GL_MODELVIEW); bglLoadIdentity();