(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.lut_tex_coord = glui_tex_coords;
|
||||||
coords.color = (coord_color) ? coord_color : color;
|
coords.color = (coord_color) ? coord_color : color;
|
||||||
|
|
||||||
glViewport(x, height - y - h, w, h);
|
menu_video_draw_frame(
|
||||||
|
x,
|
||||||
menu_video_draw_frame(gl->shader, &coords,
|
height - y - h,
|
||||||
|
w,
|
||||||
|
h,
|
||||||
|
gl->shader, &coords,
|
||||||
&gl->mvp_no_rot, true, glui->textures.white);
|
&gl->mvp_no_rot, true, glui->textures.white);
|
||||||
|
|
||||||
gl->coords.color = gl->white_color_ptr;
|
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.lut_tex_coord = rmb_tex_coord;
|
||||||
coords.color = color;
|
coords.color = color;
|
||||||
|
|
||||||
glViewport(x, height - y, xmb->icon.size, xmb->icon.size);
|
menu_video_draw_frame(
|
||||||
|
x,
|
||||||
menu_video_draw_frame(gl->shader, &coords, &mymat, false, texture);
|
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,
|
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.lut_tex_coord = rmb_tex_coord;
|
||||||
coords.color = color;
|
coords.color = color;
|
||||||
|
|
||||||
glViewport(x, height - y, xmb->icon.size, xmb->icon.size);
|
menu_video_draw_frame(
|
||||||
|
x,
|
||||||
menu_video_draw_frame(gl->shader, &coords, mymat, false, texture);
|
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)
|
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.lut_tex_coord = rmb_tex_coord;
|
||||||
coords.color = color;
|
coords.color = color;
|
||||||
|
|
||||||
glViewport(x, height - y, xmb->boxart_size, xmb->boxart_size);
|
menu_video_draw_frame(
|
||||||
|
x,
|
||||||
menu_video_draw_frame(gl->shader, &coords, &mymat, false, xmb->boxart);
|
height - y,
|
||||||
|
xmb->boxart_size,
|
||||||
|
xmb->boxart_size,
|
||||||
|
gl->shader, &coords, &mymat, false, xmb->boxart);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xmb_draw_text(menu_handle_t *menu,
|
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);
|
xmb_draw_icon_begin(gl);
|
||||||
|
|
||||||
glViewport(x, height - y, xmb->cursor.size, xmb->cursor.size);
|
menu_video_draw_frame(
|
||||||
|
x,
|
||||||
menu_video_draw_frame(gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id);
|
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)
|
static void xmb_render(void)
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
void menu_video_draw_frame(
|
void menu_video_draw_frame(
|
||||||
|
unsigned x, unsigned y,
|
||||||
|
unsigned width, unsigned height,
|
||||||
const shader_backend_t *shader,
|
const shader_backend_t *shader,
|
||||||
struct gfx_coords *coords,
|
struct gfx_coords *coords,
|
||||||
math_matrix_4x4 *mat,
|
math_matrix_4x4 *mat,
|
||||||
|
@ -32,6 +34,7 @@ void menu_video_draw_frame(
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
|
|
||||||
|
glViewport(x, y, width, height);
|
||||||
glBindTexture(GL_TEXTURE_2D, texture);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
|
|
||||||
shader->set_coords(coords);
|
shader->set_coords(coords);
|
||||||
|
@ -56,6 +59,7 @@ void menu_video_frame_background(
|
||||||
GRfloat *coord_color)
|
GRfloat *coord_color)
|
||||||
{
|
{
|
||||||
struct gfx_coords coords;
|
struct gfx_coords coords;
|
||||||
|
unsigned width, height;
|
||||||
GRfloat color[16], vertex[8], tex_coord[8];
|
GRfloat color[16], vertex[8], tex_coord[8];
|
||||||
|
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
|
@ -112,7 +116,10 @@ void menu_video_frame_background(
|
||||||
&& texture)
|
&& texture)
|
||||||
coords.color = color;
|
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->mvp_no_rot, true, texture);
|
||||||
|
|
||||||
gl->coords.color = gl->white_color_ptr;
|
gl->coords.color = gl->white_color_ptr;
|
||||||
|
|
|
@ -27,6 +27,8 @@ extern "C" {
|
||||||
#include "../gfx/drivers/gl_common.h"
|
#include "../gfx/drivers/gl_common.h"
|
||||||
|
|
||||||
void menu_video_draw_frame(
|
void menu_video_draw_frame(
|
||||||
|
unsigned x, unsigned y,
|
||||||
|
unsigned width, unsigned height,
|
||||||
const shader_backend_t *shader,
|
const shader_backend_t *shader,
|
||||||
struct gfx_coords *coords,
|
struct gfx_coords *coords,
|
||||||
math_matrix_4x4 *mat,
|
math_matrix_4x4 *mat,
|
||||||
|
|
Loading…
Reference in New Issue