mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-26 21:36:26 +00:00
(GLUI/XMB) Cleanups
This commit is contained in:
parent
c84f4efd7b
commit
eda9c179e6
@ -135,9 +135,12 @@ static void glui_render_quad(gl_t *gl, int x, int y, int w, int h,
|
||||
coords.lut_tex_coord = glui_tex_coords;
|
||||
coords.color = (coord_color) ? coord_color : color;
|
||||
|
||||
glViewport(x, height - y - h, w, h);
|
||||
|
||||
menu_video_draw_frame(gl->shader, &coords,
|
||||
menu_video_draw_frame(
|
||||
x,
|
||||
height - y - h,
|
||||
w,
|
||||
h,
|
||||
gl->shader, &coords,
|
||||
&gl->mvp_no_rot, true, glui->textures.white);
|
||||
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
|
@ -390,9 +390,12 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb,
|
||||
coords.lut_tex_coord = rmb_tex_coord;
|
||||
coords.color = color;
|
||||
|
||||
glViewport(x, height - y, xmb->icon.size, xmb->icon.size);
|
||||
|
||||
menu_video_draw_frame(gl->shader, &coords, &mymat, false, texture);
|
||||
menu_video_draw_frame(
|
||||
x,
|
||||
height - y,
|
||||
xmb->icon.size,
|
||||
xmb->icon.size,
|
||||
gl->shader, &coords, &mymat, false, texture);
|
||||
}
|
||||
|
||||
static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
|
||||
@ -445,9 +448,12 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
|
||||
coords.lut_tex_coord = rmb_tex_coord;
|
||||
coords.color = color;
|
||||
|
||||
glViewport(x, height - y, xmb->icon.size, xmb->icon.size);
|
||||
|
||||
menu_video_draw_frame(gl->shader, &coords, mymat, false, texture);
|
||||
menu_video_draw_frame(
|
||||
x,
|
||||
height - y,
|
||||
xmb->icon.size,
|
||||
xmb->icon.size,
|
||||
gl->shader, &coords, mymat, false, texture);
|
||||
}
|
||||
|
||||
static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb)
|
||||
@ -494,9 +500,12 @@ static void xmb_draw_boxart(gl_t *gl, xmb_handle_t *xmb)
|
||||
coords.lut_tex_coord = rmb_tex_coord;
|
||||
coords.color = color;
|
||||
|
||||
glViewport(x, height - y, xmb->boxart_size, xmb->boxart_size);
|
||||
|
||||
menu_video_draw_frame(gl->shader, &coords, &mymat, false, xmb->boxart);
|
||||
menu_video_draw_frame(
|
||||
x,
|
||||
height - y,
|
||||
xmb->boxart_size,
|
||||
xmb->boxart_size,
|
||||
gl->shader, &coords, &mymat, false, xmb->boxart);
|
||||
}
|
||||
|
||||
static void xmb_draw_text(menu_handle_t *menu,
|
||||
@ -1469,9 +1478,12 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb, float x, float y)
|
||||
|
||||
xmb_draw_icon_begin(gl);
|
||||
|
||||
glViewport(x, height - y, xmb->cursor.size, xmb->cursor.size);
|
||||
|
||||
menu_video_draw_frame(gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id);
|
||||
menu_video_draw_frame(
|
||||
x,
|
||||
height - y,
|
||||
xmb->cursor.size,
|
||||
xmb->cursor.size,
|
||||
gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id);
|
||||
}
|
||||
|
||||
static void xmb_render(void)
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#ifdef HAVE_OPENGL
|
||||
void menu_video_draw_frame(
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
const shader_backend_t *shader,
|
||||
struct gfx_coords *coords,
|
||||
math_matrix_4x4 *mat,
|
||||
@ -32,6 +34,7 @@ void menu_video_draw_frame(
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
|
||||
glViewport(x, y, width, height);
|
||||
glBindTexture(GL_TEXTURE_2D, texture);
|
||||
|
||||
shader->set_coords(coords);
|
||||
@ -56,6 +59,7 @@ void menu_video_frame_background(
|
||||
GRfloat *coord_color)
|
||||
{
|
||||
struct gfx_coords coords;
|
||||
unsigned width, height;
|
||||
GRfloat color[16], vertex[8], tex_coord[8];
|
||||
|
||||
global_t *global = global_get_ptr();
|
||||
@ -112,7 +116,10 @@ void menu_video_frame_background(
|
||||
&& texture)
|
||||
coords.color = color;
|
||||
|
||||
menu_video_draw_frame(gl->shader, &coords,
|
||||
video_driver_get_size(&width, &height);
|
||||
|
||||
menu_video_draw_frame(0, 0, width, height,
|
||||
gl->shader, &coords,
|
||||
&gl->mvp_no_rot, true, texture);
|
||||
|
||||
gl->coords.color = gl->white_color_ptr;
|
||||
|
@ -27,6 +27,8 @@ extern "C" {
|
||||
#include "../gfx/drivers/gl_common.h"
|
||||
|
||||
void menu_video_draw_frame(
|
||||
unsigned x, unsigned y,
|
||||
unsigned width, unsigned height,
|
||||
const shader_backend_t *shader,
|
||||
struct gfx_coords *coords,
|
||||
math_matrix_4x4 *mat,
|
||||
|
Loading…
x
Reference in New Issue
Block a user