diff --git a/gfx/context/ps3_ctx.c b/gfx/context/ps3_ctx.c index 67605a8199..0822cbc4ee 100644 --- a/gfx/context/ps3_ctx.c +++ b/gfx/context/ps3_ctx.c @@ -381,7 +381,7 @@ void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_r glVertexPointer(2, GL_FLOAT, 0, vertex_ptr); - glOrtho(ortho->left, ortho->right, ortho->bottom, ortho->top, ortho->near, ortho->far); + glOrtho(ortho->left, ortho->right, ortho->bottom, ortho->top, ortho->znear, ortho->zfar); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } diff --git a/gfx/context/sdl_ctx.c b/gfx/context/sdl_ctx.c index ef12ee9eeb..9ebd8bf7e1 100644 --- a/gfx/context/sdl_ctx.c +++ b/gfx/context/sdl_ctx.c @@ -406,7 +406,7 @@ void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_r if (allow_rotate) glRotatef(gl->rotation, 0, 0, 1); - glOrtho(ortho->left, ortho->right, ortho->bottom, ortho->top, ortho->near, ortho->far); + glOrtho(ortho->left, ortho->right, ortho->bottom, ortho->top, ortho->znear, ortho->zfar); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } diff --git a/gfx/gl.c b/gfx/gl.c index 348eed8538..7a2a58643b 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -452,8 +452,8 @@ void gl_set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_full, ortho.right = 1.0f; ortho.bottom = 0.0f; ortho.top = 1.0f; - ortho.near = -1.0f; - ortho.far = 1.0f; + ortho.znear = -1.0f; + ortho.zfar = 1.0f; if (gl->keep_aspect && !force_full) { @@ -514,14 +514,7 @@ void gl_set_viewport(gl_t *gl, unsigned width, unsigned height, bool force_full, static void gl_set_rotation(void *data, unsigned rotation) { - struct gl_ortho ortho = {0}; - - ortho.left = 0; - ortho.right = 1; - ortho.bottom = 0; - ortho.top = 1; - ortho.near = -1; - ortho.far = 1; + struct gl_ortho ortho = {0, 1, 0, 1, -1, 1}; gl_t *gl = (gl_t*)driver.video_data; gl->rotation = 90 * rotation; diff --git a/gfx/gl_common.h b/gfx/gl_common.h index 616cea7c32..0cb15c479c 100644 --- a/gfx/gl_common.h +++ b/gfx/gl_common.h @@ -107,17 +107,14 @@ struct gl_fbo_scale bool valid; }; -// DOS creeps into Win32, yay. -#undef near -#undef far struct gl_ortho { GLfloat left; GLfloat right; GLfloat bottom; GLfloat top; - GLfloat near; - GLfloat far; + GLfloat znear; + GLfloat zfar; }; struct gl_tex_info