Turn fixed-function vertex coord/matrix code into macros
This commit is contained in:
parent
aed7afb31d
commit
53c7bf65ed
9
driver.c
9
driver.c
|
@ -1551,12 +1551,9 @@ void *driver_video_resolve(const video_driver_t **drv)
|
||||||
if (g_settings.video.threaded
|
if (g_settings.video.threaded
|
||||||
&& !g_extern.system.hw_render_callback.context_type)
|
&& !g_extern.system.hw_render_callback.context_type)
|
||||||
return rarch_threaded_video_resolve(drv);
|
return rarch_threaded_video_resolve(drv);
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
if (drv)
|
||||||
if (drv)
|
*drv = driver.video;
|
||||||
*drv = driver.video;
|
|
||||||
|
|
||||||
return driver.video_data;
|
return driver.video_data;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,30 +90,13 @@ void gl_shader_set_coords(gl_t *gl,
|
||||||
if (!gl->shader->set_coords(coords))
|
if (!gl->shader->set_coords(coords))
|
||||||
{
|
{
|
||||||
#ifndef NO_GL_FF_VERTEX
|
#ifndef NO_GL_FF_VERTEX
|
||||||
/* Fall back to FF-style if needed and possible. */
|
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);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (!gl->shader->set_mvp(gl, mat))
|
if (!gl->shader->set_mvp(gl, mat))
|
||||||
{
|
{
|
||||||
#ifndef NO_GL_FF_MATRIX
|
#ifndef NO_GL_FF_MATRIX
|
||||||
/* Fall back to FF-style if needed and possible. */
|
gl_ff_matrix(mat);
|
||||||
glMatrixMode(GL_PROJECTION);
|
|
||||||
glLoadMatrixf(mat->data);
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
|
||||||
glLoadIdentity();
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,12 +355,16 @@ extern void glBufferSubDataTextureReferenceRA( GLenum target,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_OPENGL_MODERN) || defined(HAVE_OPENGLES2) || defined(HAVE_PSGL)
|
#if defined(HAVE_OPENGL_MODERN) || defined(HAVE_OPENGLES2) || defined(HAVE_PSGL)
|
||||||
|
#ifndef NO_GL_FF_VERTEX
|
||||||
#define NO_GL_FF_VERTEX
|
#define NO_GL_FF_VERTEX
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_OPENGL_MODERN) || defined(HAVE_OPENGLES2) || defined(HAVE_PSGL)
|
#if defined(HAVE_OPENGL_MODERN) || defined(HAVE_OPENGLES2) || defined(HAVE_PSGL)
|
||||||
|
#ifndef NO_GL_FF_MATRIX
|
||||||
#define NO_GL_FF_MATRIX
|
#define NO_GL_FF_MATRIX
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_OPENGLES2) /* TODO: Figure out exactly what. */
|
#if defined(HAVE_OPENGLES2) /* TODO: Figure out exactly what. */
|
||||||
#define NO_GL_CLAMP_TO_BORDER
|
#define NO_GL_CLAMP_TO_BORDER
|
||||||
|
@ -376,6 +380,26 @@ extern void glBufferSubDataTextureReferenceRA( GLenum target,
|
||||||
#endif
|
#endif
|
||||||
#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()
|
||||||
|
|
||||||
void gl_set_viewport(gl_t *gl, unsigned width, unsigned height,
|
void gl_set_viewport(gl_t *gl, unsigned width, unsigned height,
|
||||||
bool force_full, bool allow_rotate);
|
bool force_full, bool allow_rotate);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue