[gl/glsl] Shift the 2d view by 0.5 pixels in X and Y

Fixes top and left edge lines not being visible (same story as vulkan).
This commit is contained in:
Bill Currie 2022-09-28 22:50:44 +09:00
parent 2d634b7cf7
commit c0e3821fa6
2 changed files with 3 additions and 2 deletions

View file

@ -970,7 +970,7 @@ set_2d (int width, int height)
qfglMatrixMode (GL_PROJECTION);
qfglLoadIdentity ();
qfglOrtho (0, width, height, 0, -99999, 99999);
qfglOrtho (-0.5, width - 0.5, height - 0.5, -0.5, -99999, 99999);
qfglMatrixMode (GL_MODELVIEW);
qfglLoadIdentity ();

View file

@ -799,7 +799,8 @@ set_2d (int width, int height)
qfeglDisable (GL_DEPTH_TEST);
qfeglDisable (GL_CULL_FACE);
ortho_mat (proj_matrix, 0, width, height, 0, -99999, 99999);
ortho_mat (proj_matrix, -0.5, width - 0.5, height - 0.5, -0.5,
-99999, 99999);
qfeglUseProgram (quake_2d.program);
qfeglEnableVertexAttribArray (quake_2d.vertex.location);