mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 10:40:39 +00:00
Turn gl_ff_vertex/gl_ff_matrix into functions
This commit is contained in:
parent
8eab7e6631
commit
09c481342b
@ -182,9 +182,7 @@ static bool gl_cg_set_mvp(void *data, const math_matrix_4x4 *mat)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
gl_ff_matrix(mat);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -213,9 +211,7 @@ static bool gl_cg_set_coords(const void *data)
|
||||
|
||||
return true;
|
||||
fallback:
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
gl_ff_vertex(coords);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1143,9 +1143,7 @@ static bool gl_glsl_set_mvp(void *data, const math_matrix_4x4 *mat)
|
||||
|
||||
if (!glsl || !glsl->glsl_shader->modern)
|
||||
{
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
gl_ff_matrix(mat);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1171,9 +1169,7 @@ static bool gl_glsl_set_coords(const void *data)
|
||||
|
||||
if (!glsl || !glsl->glsl_shader->modern || !coords)
|
||||
{
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
gl_ff_vertex(coords);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1184,9 +1180,7 @@ static bool gl_glsl_set_coords(const void *data)
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
gl_ff_vertex(coords);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,38 @@
|
||||
|
||||
#include "gl_common.h"
|
||||
|
||||
void gl_ff_vertex(const void *data)
|
||||
{
|
||||
#ifndef NO_GL_FF_VERTEX
|
||||
const struct gl_coords *coords = (const struct gl_coords*)data;
|
||||
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glClientActiveTexture(GL_TEXTURE1);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glClientActiveTexture(GL_TEXTURE0);
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color);
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
#endif
|
||||
}
|
||||
|
||||
void gl_ff_matrix(const void *data)
|
||||
{
|
||||
#ifndef NO_GL_FF_MATRIX
|
||||
const math_matrix_4x4 *mat = (const math_matrix_4x4*)data;
|
||||
|
||||
/* Fall back to fixed function-style if needed and possible. */
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadMatrixf(mat->data);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
#endif
|
||||
}
|
||||
|
||||
void gl_load_texture_data(GLuint id,
|
||||
enum gfx_wrap_type wrap_type,
|
||||
enum texture_filter_type filter_type,
|
||||
|
@ -181,25 +181,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Fall back to FF-style if needed and possible. */
|
||||
#define gl_ff_vertex(coords) \
|
||||
glClientActiveTexture(GL_TEXTURE1); \
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->lut_tex_coord); \
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY); \
|
||||
glClientActiveTexture(GL_TEXTURE0); \
|
||||
glVertexPointer(2, GL_FLOAT, 0, coords->vertex); \
|
||||
glEnableClientState(GL_VERTEX_ARRAY); \
|
||||
glColorPointer(4, GL_FLOAT, 0, coords->color); \
|
||||
glEnableClientState(GL_COLOR_ARRAY); \
|
||||
glTexCoordPointer(2, GL_FLOAT, 0, coords->tex_coord); \
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY)
|
||||
|
||||
/* Fall back to FF-style if needed and possible. */
|
||||
#define gl_ff_matrix(mat) \
|
||||
glMatrixMode(GL_PROJECTION); \
|
||||
glLoadMatrixf(mat->data); \
|
||||
glMatrixMode(GL_MODELVIEW); \
|
||||
glLoadIdentity()
|
||||
|
||||
struct gl_fbo_rect
|
||||
{
|
||||
@ -455,4 +436,7 @@ static INLINE unsigned gl_wrap_type_to_enum(enum gfx_wrap_type type)
|
||||
bool gl_coord_array_add(gl_coord_array_t *ca, const gl_coords_t *coords, unsigned count);
|
||||
void gl_coord_array_free(gl_coord_array_t *ca);
|
||||
|
||||
void gl_ff_vertex(const void *data);
|
||||
void gl_ff_matrix(const void *data);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user