Avoid ugly #undefs.
This commit is contained in:
parent
fea9aa9e9c
commit
2d3fed35e7
|
@ -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);
|
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);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
|
@ -406,7 +406,7 @@ void gfx_ctx_set_projection(gl_t *gl, const struct gl_ortho *ortho, bool allow_r
|
||||||
if (allow_rotate)
|
if (allow_rotate)
|
||||||
glRotatef(gl->rotation, 0, 0, 1);
|
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);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
}
|
}
|
||||||
|
|
13
gfx/gl.c
13
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.right = 1.0f;
|
||||||
ortho.bottom = 0.0f;
|
ortho.bottom = 0.0f;
|
||||||
ortho.top = 1.0f;
|
ortho.top = 1.0f;
|
||||||
ortho.near = -1.0f;
|
ortho.znear = -1.0f;
|
||||||
ortho.far = 1.0f;
|
ortho.zfar = 1.0f;
|
||||||
|
|
||||||
if (gl->keep_aspect && !force_full)
|
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)
|
static void gl_set_rotation(void *data, unsigned rotation)
|
||||||
{
|
{
|
||||||
struct gl_ortho ortho = {0};
|
struct gl_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||||
|
|
||||||
ortho.left = 0;
|
|
||||||
ortho.right = 1;
|
|
||||||
ortho.bottom = 0;
|
|
||||||
ortho.top = 1;
|
|
||||||
ortho.near = -1;
|
|
||||||
ortho.far = 1;
|
|
||||||
|
|
||||||
gl_t *gl = (gl_t*)driver.video_data;
|
gl_t *gl = (gl_t*)driver.video_data;
|
||||||
gl->rotation = 90 * rotation;
|
gl->rotation = 90 * rotation;
|
||||||
|
|
|
@ -107,17 +107,14 @@ struct gl_fbo_scale
|
||||||
bool valid;
|
bool valid;
|
||||||
};
|
};
|
||||||
|
|
||||||
// DOS creeps into Win32, yay.
|
|
||||||
#undef near
|
|
||||||
#undef far
|
|
||||||
struct gl_ortho
|
struct gl_ortho
|
||||||
{
|
{
|
||||||
GLfloat left;
|
GLfloat left;
|
||||||
GLfloat right;
|
GLfloat right;
|
||||||
GLfloat bottom;
|
GLfloat bottom;
|
||||||
GLfloat top;
|
GLfloat top;
|
||||||
GLfloat near;
|
GLfloat znear;
|
||||||
GLfloat far;
|
GLfloat zfar;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct gl_tex_info
|
struct gl_tex_info
|
||||||
|
|
Loading…
Reference in New Issue