No longer do blending inside menu_display_draw_frame

This commit is contained in:
twinaphex 2015-11-01 19:24:35 +01:00
parent 5a17b79b48
commit 2b087f3be0
5 changed files with 24 additions and 19 deletions

View File

@ -202,7 +202,7 @@ static void glui_draw_icon(gl_t *gl, glui_handle_t *glui,
height - y - glui->icon_size, height - y - glui->icon_size,
glui->icon_size, glui->icon_size,
glui->icon_size, glui->icon_size,
gl->shader, &coords, &mymat, false, texture, 4, gl->shader, &coords, &mymat, texture, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); MENU_DISPLAY_PRIM_TRIANGLESTRIP);
menu_display_draw_icon_blend_end(gl); menu_display_draw_icon_blend_end(gl);
@ -251,16 +251,20 @@ 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; coords.color = coord_color;
menu_display_draw_icon_blend_begin(gl);
menu_display_draw_frame( menu_display_draw_frame(
x, x,
height - y - h, height - y - h,
w, w,
h, h,
gl->shader, &coords, gl->shader, &coords,
&gl->mvp_no_rot, true, glui->textures.white, 4, &gl->mvp_no_rot, glui->textures.white, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP ); MENU_DISPLAY_PRIM_TRIANGLESTRIP );
gl->coords.color = gl->white_color_ptr; gl->coords.color = gl->white_color_ptr;
menu_display_draw_icon_blend_end(gl);
} }
static void glui_draw_scrollbar(gl_t *gl, unsigned width, unsigned height, GRfloat *coord_color) static void glui_draw_scrollbar(gl_t *gl, unsigned width, unsigned height, GRfloat *coord_color)
@ -592,7 +596,8 @@ static void glui_draw_cursor(gl_t *gl, glui_handle_t *glui,
height - y - 32, height - y - 32,
64, 64,
64, 64,
gl->shader, &coords, &mymat, true, glui->textures.list[GLUI_TEXTURE_POINTER].id, 4, gl->shader, &coords, &mymat,
glui->textures.list[GLUI_TEXTURE_POINTER].id, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); MENU_DISPLAY_PRIM_TRIANGLESTRIP);
} }

View File

@ -378,7 +378,7 @@ static void xmb_draw_icon(gl_t *gl, xmb_handle_t *xmb,
height - y, height - y,
xmb->icon.size, xmb->icon.size,
xmb->icon.size, xmb->icon.size,
gl->shader, &coords, &mymat, false, texture, 4, gl->shader, &coords, &mymat, texture, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); MENU_DISPLAY_PRIM_TRIANGLESTRIP);
} }
@ -410,7 +410,7 @@ static void xmb_draw_icon_predone(gl_t *gl, xmb_handle_t *xmb,
height - y, height - y,
xmb->icon.size, xmb->icon.size,
xmb->icon.size, xmb->icon.size,
gl->shader, &coords, mymat, false, texture, 4, gl->shader, &coords, mymat, texture, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); 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, height - y,
xmb->boxart_size, xmb->boxart_size,
xmb->boxart_size, xmb->boxart_size,
gl->shader, &coords, &mymat, false, xmb->boxart, 4, gl->shader, &coords, &mymat, xmb->boxart, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); MENU_DISPLAY_PRIM_TRIANGLESTRIP);
} }
@ -1447,8 +1447,10 @@ static void xmb_draw_cursor(gl_t *gl, xmb_handle_t *xmb,
height - y - (xmb->cursor.size/2), height - y - (xmb->cursor.size/2),
xmb->cursor.size, xmb->cursor.size,
xmb->cursor.size, xmb->cursor.size,
gl->shader, &coords, &mymat, true, xmb->textures.list[XMB_TEXTURE_POINTER].id, 4, gl->shader, &coords, &mymat, xmb->textures.list[XMB_TEXTURE_POINTER].id, 4,
MENU_DISPLAY_PRIM_TRIANGLESTRIP); MENU_DISPLAY_PRIM_TRIANGLESTRIP);
menu_display_draw_icon_blend_end(gl);
} }
static void xmb_render(void) static void xmb_render(void)

View File

@ -1051,22 +1051,24 @@ static void zarch_frame(void)
zarch_zui_draw_cursor(gl, zarch_zui_input_state(zui, MENU_ZARCH_MOUSE_X), zarch_zui_input_state(zui, MENU_ZARCH_MOUSE_Y)); zarch_zui_draw_cursor(gl, zarch_zui_input_state(zui, MENU_ZARCH_MOUSE_X), zarch_zui_input_state(zui, MENU_ZARCH_MOUSE_Y));
gl->shader->use(gl, GL_SHADER_STOCK_BLEND);
if (!zarch_zui_input_state(zui, MENU_ZARCH_PRESSED)) if (!zarch_zui_input_state(zui, MENU_ZARCH_PRESSED))
zui->item.active = 0; zui->item.active = 0;
else if (zui->item.active == 0) else if (zui->item.active == 0)
zui->item.active = -1; zui->item.active = -1;
menu_display_draw_icon_blend_begin(gl);
menu_display_draw_frame( menu_display_draw_frame(
0, 0,
0, 0,
zui->width, zui->width,
zui->height, zui->height,
gl->shader, (struct gfx_coords*)&zui->ca, gl->shader, (struct gfx_coords*)&zui->ca,
&zui->mvp, true, zui->textures.white, zui->ca.coords.vertices, &zui->mvp, zui->textures.white, zui->ca.coords.vertices,
MENU_DISPLAY_PRIM_TRIANGLES); MENU_DISPLAY_PRIM_TRIANGLES);
menu_display_draw_icon_blend_end(gl);
menu_display_frame_background(menu, settings, menu_display_frame_background(menu, settings,
gl, zui->width, zui->height, gl, zui->width, zui->height,
zui->textures.bg.id, 0.75f, false, zui->textures.bg.id, 0.75f, false,

View File

@ -530,7 +530,6 @@ void menu_display_draw_frame(
const void *shader_data, const void *shader_data,
struct gfx_coords *coords, struct gfx_coords *coords,
math_matrix_4x4 *mat, math_matrix_4x4 *mat,
bool blend,
GLuint texture, GLuint texture,
size_t vertex_count, size_t vertex_count,
enum menu_display_prim_type prim_type enum menu_display_prim_type prim_type
@ -549,13 +548,7 @@ void menu_display_draw_frame(
shader->set_coords(coords); shader->set_coords(coords);
shader->set_mvp(driver->video_data, mat); shader->set_mvp(driver->video_data, mat);
if (blend)
glEnable(GL_BLEND);
glDrawArrays(menu_display_prim_to_gl_enum(prim_type), 0, vertex_count); glDrawArrays(menu_display_prim_to_gl_enum(prim_type), 0, vertex_count);
if (blend)
glDisable(GL_BLEND);
} }
void menu_display_frame_background( void menu_display_frame_background(
@ -594,10 +587,14 @@ void menu_display_frame_background(
&& !force_transparency && !force_transparency
&& texture) && texture)
coords.color = (const float*)coord_color2; coords.color = (const float*)coord_color2;
menu_display_draw_icon_blend_begin(gl);
menu_display_draw_frame(0, 0, width, height, menu_display_draw_frame(0, 0, width, height,
gl->shader, &coords, gl->shader, &coords,
&gl->mvp_no_rot, true, texture, vertex_count, prim_type); &gl->mvp_no_rot, texture, vertex_count, prim_type);
menu_display_draw_icon_blend_end(gl);
gl->coords.color = gl->white_color_ptr; gl->coords.color = gl->white_color_ptr;
} }

View File

@ -99,7 +99,6 @@ void menu_display_draw_frame(
const void *shader, const void *shader,
struct gfx_coords *coords, struct gfx_coords *coords,
math_matrix_4x4 *mat, math_matrix_4x4 *mat,
bool blend,
GLuint texture, GLuint texture,
size_t vertex_count, size_t vertex_count,
enum menu_display_prim_type prim_type enum menu_display_prim_type prim_type