Create video_shader_driver_set_coords and video_shader_driver_set_mvp

This commit is contained in:
twinaphex 2015-12-04 16:33:07 +01:00
parent 827b3cc89b
commit a2da59ac9b
3 changed files with 28 additions and 10 deletions

View File

@ -1117,8 +1117,8 @@ static void gl_frame_fbo(gl_t *gl, uint64_t frame_count,
tex_info, gl->prev_info, feedback_info, fbo_tex_info, fbo_tex_info_cnt);
gl->coords.vertices = 4;
gl->shader->set_coords(&gl->coords);
gl->shader->set_mvp(gl, &gl->mvp);
video_shader_driver_set_coords(gl->shader, &gl->coords);
video_shader_driver_set_mvp(gl->shader, gl, &gl->mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
@ -1166,8 +1166,8 @@ static void gl_frame_fbo(gl_t *gl, uint64_t frame_count,
gl->coords.vertex = gl->vertex_ptr;
gl->coords.vertices = 4;
gl->shader->set_coords(&gl->coords);
gl->shader->set_mvp(gl, &gl->mvp);
video_shader_driver_set_coords(gl->shader, &gl->coords);
video_shader_driver_set_mvp(gl->shader, gl, &gl->mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
gl->coords.tex_coord = gl->tex_info.coord;
@ -1605,8 +1605,8 @@ static INLINE void gl_draw_texture(gl_t *gl)
video_shader_driver_use(gl->shader, gl, GL_SHADER_STOCK_BLEND);
gl->coords.vertices = 4;
gl->shader->set_coords(&gl->coords);
gl->shader->set_mvp(gl, &gl->mvp_no_rot);
video_shader_driver_set_coords(gl->shader, &gl->coords);
video_shader_driver_set_mvp(gl->shader, gl, &gl->mvp_no_rot);
glEnable(GL_BLEND);
@ -1774,8 +1774,8 @@ static bool gl_frame(void *data, const void *frame,
NULL, 0);
gl->coords.vertices = 4;
gl->shader->set_coords(&gl->coords);
gl->shader->set_mvp(gl, &gl->mvp);
video_shader_driver_set_coords(gl->shader, &gl->coords);
video_shader_driver_set_mvp(gl->shader, gl, &gl->mvp);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
#ifdef HAVE_FBO
@ -3247,8 +3247,8 @@ static void gl_render_overlay(void *data)
gl->coords.color = gl->overlay_color_coord;
gl->coords.vertices = 4 * gl->overlays;
gl->shader->set_coords(&gl->coords);
gl->shader->set_mvp(gl, &gl->mvp_no_rot);
video_shader_driver_set_coords(gl->shader, &gl->coords);
video_shader_driver_set_mvp(gl->shader, gl, &gl->mvp_no_rot);
for (i = 0; i < gl->overlays; i++)
{

View File

@ -134,3 +134,17 @@ unsigned video_shader_driver_num_shaders(const shader_backend_t *shader)
return 0;
return shader->num_shaders();
}
bool video_shader_driver_set_coords(const shader_backend_t *shader, const void *data)
{
if (!shader || !shader->set_coords)
return false;
return shader->set_coords(data);
}
bool video_shader_driver_set_mvp(const shader_backend_t *shader, void *data, const math_matrix_4x4 *mat)
{
if (!shader || !shader->set_mvp)
return false;
return shader->set_mvp(data, mat);
}

View File

@ -128,6 +128,10 @@ bool video_shader_driver_mipmap_input(const shader_backend_t *shader, unsigned i
unsigned video_shader_driver_num_shaders(const shader_backend_t *shader);
bool video_shader_driver_set_coords(const shader_backend_t *shader, const void *data);
bool video_shader_driver_set_mvp(const shader_backend_t *shader, void *data, const math_matrix_4x4 *mat);
#ifdef __cplusplus
}
#endif