Move gl_ff_matrix to gfx/video_driver.c

This commit is contained in:
twinaphex 2017-11-13 12:15:28 +01:00
parent f53fe4a07c
commit ade80dbe76
2 changed files with 9 additions and 18 deletions

View File

@ -160,22 +160,6 @@ static INLINE void gl_ff_vertex(const struct video_coords *coords)
}
#endif
#ifdef NO_GL_FF_MATRIX
#define gl_ff_matrix(mat) ((void)0)
#else
static INLINE void gl_ff_matrix(const math_matrix_4x4 *mat)
{
math_matrix_4x4 ident;
/* Fall back to fixed function-style if needed and possible. */
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(mat->data);
glMatrixMode(GL_MODELVIEW);
matrix_4x4_identity(ident);
glLoadMatrixf(ident.data);
}
#endif
static INLINE void gl_bind_texture(GLuint id, GLint wrap_mode, GLint mag_filter,
GLint min_filter)
{

View File

@ -3226,8 +3226,15 @@ static bool video_shader_driver_set_mvp_null(void *data,
static bool video_shader_driver_set_mvp_null_gl(void *data,
void *shader_data, const math_matrix_4x4 *mat)
{
gl_ff_matrix(mat);
return false;
math_matrix_4x4 ident;
/* Fall back to fixed function-style if needed and possible. */
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(mat->data);
glMatrixMode(GL_MODELVIEW);
matrix_4x4_identity(ident);
glLoadMatrixf(ident.data);
return true;
}
#endif
#endif