Polymer screen resizing support. Fixes misaligned crosshair with full HUD.

git-svn-id: https://svn.eduke32.com/eduke32@1504 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
plagman 2009-09-30 00:51:45 +00:00
parent f8f554206f
commit d1e22bae52

View file

@ -652,7 +652,7 @@ void polymer_glinit(void)
bglClearColor(0.0f, 0.0f, 0.0f, 1.0f); bglClearColor(0.0f, 0.0f, 0.0f, 1.0f);
bglClearStencil(0); bglClearStencil(0);
bglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 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 // texturing
bglEnable(GL_TEXTURE_2D); bglEnable(GL_TEXTURE_2D);
@ -672,7 +672,10 @@ void polymer_glinit(void)
bglMatrixMode(GL_PROJECTION); bglMatrixMode(GL_PROJECTION);
bglLoadIdentity(); 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); bglMatrixMode(GL_MODELVIEW);
bglLoadIdentity(); bglLoadIdentity();