mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-30 14:53:39 +00:00
Start making menu drivers depend less on gl handle
This commit is contained in:
parent
d132cfac7c
commit
6516fc783b
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user