diff --git a/menu/drivers/glui.c b/menu/drivers/glui.c index 03ee0f165c..7b670964a5 100644 --- a/menu/drivers/glui.c +++ b/menu/drivers/glui.c @@ -202,7 +202,7 @@ static void glui_draw_icon(gl_t *gl, glui_handle_t *glui, height - y - glui->icon_size, glui->icon_size, glui->icon_size, - gl->shader, &coords, &mymat, texture, 4, + &coords, &mymat, texture, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); menu_display_blend_end(gl); @@ -258,7 +258,7 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h, height - y - h, w, h, - gl->shader, &coords, + &coords, &gl->mvp_no_rot, glui->textures.white, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP ); @@ -598,7 +598,7 @@ static void glui_draw_cursor(gl_t *gl, glui_handle_t *glui, height - y - 32, 64, 64, - gl->shader, &coords, &mymat, + &coords, &mymat, glui->textures.list[GLUI_TEXTURE_POINTER].id, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index f0d33f0c48..0a9c33b7c5 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -378,7 +378,7 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb, height - y, xmb->icon.size, xmb->icon.size, - gl->shader, &coords, &mymat, texture, 4, + &coords, &mymat, texture, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); } @@ -410,7 +410,7 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb, height - y, xmb->icon.size, xmb->icon.size, - gl->shader, &coords, mymat, texture, 4, + &coords, mymat, texture, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); } @@ -442,7 +442,7 @@ static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb, GRfloat *color, unsigne height - y, xmb->boxart_size, xmb->boxart_size, - gl->shader, &coords, &mymat, xmb->boxart, 4, + &coords, &mymat, xmb->boxart, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); } @@ -1447,7 +1447,7 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb, height - y - (xmb->cursor.size/2), xmb->cursor.size, xmb->cursor.size, - gl->shader, &coords, &mymat, xmb->textures.list[XMB_TEXTURE_POINTER].id, 4, + &coords, &mymat, xmb->textures.list[XMB_TEXTURE_POINTER].id, 4, MENU_DISPLAY_PRIM_TRIANGLESTRIP); menu_display_blend_end(gl); diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 2af51efc46..9a0604fd2a 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -1063,7 +1063,7 @@ static void zarch_frame(void) 0, zui->width, zui->height, - gl->shader, (struct gfx_coords*)&zui->ca, + (struct gfx_coords*)&zui->ca, &zui->mvp, zui->textures.white, zui->ca.coords.vertices, MENU_DISPLAY_PRIM_TRIANGLES); diff --git a/menu/menu_display.c b/menu/menu_display.c index 3e62e902e8..8c273c69b4 100644 --- a/menu/menu_display.c +++ b/menu/menu_display.c @@ -527,7 +527,6 @@ void menu_display_blend_end(void *data) void menu_display_draw_frame( unsigned x, unsigned y, unsigned width, unsigned height, - const void *shader_data, struct gfx_coords *coords, math_matrix_4x4 *mat, GLuint texture, @@ -535,8 +534,11 @@ void menu_display_draw_frame( enum menu_display_prim_type prim_type ) { - const shader_backend_t *shader = (const shader_backend_t*)shader_data; driver_t *driver = driver_get_ptr(); + gl_t *gl = (gl_t*)video_driver_get_ptr(NULL); + + if (!gl) + return; /* TODO - edge case */ if (height <= 0) @@ -545,8 +547,8 @@ void menu_display_draw_frame( glViewport(x, y, width, height); glBindTexture(GL_TEXTURE_2D, texture); - shader->set_coords(coords); - shader->set_mvp(driver->video_data, mat); + gl->shader->set_coords(coords); + gl->shader->set_mvp(driver->video_data, mat); glDrawArrays(menu_display_prim_to_gl_enum(prim_type), 0, vertex_count); } @@ -588,8 +590,8 @@ void menu_display_frame_background( coords.color = (const float*)coord_color2; menu_display_draw_frame(0, 0, width, height, - gl->shader, &coords, - &gl->mvp_no_rot, texture, vertex_count, prim_type); + &coords, &gl->mvp_no_rot, + texture, vertex_count, prim_type); menu_display_blend_end(gl); diff --git a/menu/menu_display.h b/menu/menu_display.h index f9045f2862..8f2d9dc754 100644 --- a/menu/menu_display.h +++ b/menu/menu_display.h @@ -96,7 +96,6 @@ void menu_display_msg_queue_push(const char *msg, unsigned prio, unsigned durati void menu_display_draw_frame( unsigned x, unsigned y, unsigned width, unsigned height, - const void *shader, struct gfx_coords *coords, math_matrix_4x4 *mat, GLuint texture,