mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(GLUI) Fix fullscreen rendering
This commit is contained in:
parent
6f48867cce
commit
2115e806a7
@ -18,6 +18,8 @@
|
|||||||
#include "../font_gl_driver.h"
|
#include "../font_gl_driver.h"
|
||||||
#include "../video_shader_driver.h"
|
#include "../video_shader_driver.h"
|
||||||
|
|
||||||
|
/* TODO: Move viewport side effects to the caller: it's a source of bugs. */
|
||||||
|
|
||||||
#define emit(c, vx, vy) do { \
|
#define emit(c, vx, vy) do { \
|
||||||
font_vertex[ 2 * (6 * i + c) + 0] = (x + (delta_x + off_x + vx * width) * scale) * inv_win_width; \
|
font_vertex[ 2 * (6 * i + c) + 0] = (x + (delta_x + off_x + vx * width) * scale) * inv_win_width; \
|
||||||
font_vertex[ 2 * (6 * i + c) + 1] = (y + (delta_y - off_y - vy * height) * scale) * inv_win_height; \
|
font_vertex[ 2 * (6 * i + c) + 1] = (y + (delta_y - off_y - vy * height) * scale) * inv_win_height; \
|
||||||
|
@ -49,6 +49,7 @@ typedef struct glui_handle
|
|||||||
} textures;
|
} textures;
|
||||||
|
|
||||||
gl_font_raster_block_t raster_block;
|
gl_font_raster_block_t raster_block;
|
||||||
|
bool use_blocks;
|
||||||
} glui_handle_t;
|
} glui_handle_t;
|
||||||
|
|
||||||
static int glui_entry_iterate(unsigned action)
|
static int glui_entry_iterate(unsigned action)
|
||||||
@ -354,15 +355,17 @@ static void glui_frame(void)
|
|||||||
&& !menu->msg_force)
|
&& !menu->msg_force)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
glViewport(0, 0, gl->win_width, gl->win_height);
|
gl_set_viewport(gl, gl->win_width, gl->win_height, true, false);
|
||||||
|
|
||||||
glui_render_background(settings, gl, glui, false);
|
glui_render_background(settings, gl, glui, false);
|
||||||
|
|
||||||
if (gl->font_driver->bind_block)
|
if (glui->use_blocks)
|
||||||
|
{
|
||||||
gl->font_driver->bind_block(gl->font_handle, &glui->raster_block);
|
gl->font_driver->bind_block(gl->font_handle, &glui->raster_block);
|
||||||
|
|
||||||
if (!menu_display_update_pending())
|
if (!menu_display_update_pending())
|
||||||
goto draw_text;
|
goto draw_text;
|
||||||
|
}
|
||||||
|
|
||||||
glui->raster_block.carr.coords.vertices = 0;
|
glui->raster_block.carr.coords.vertices = 0;
|
||||||
|
|
||||||
@ -481,7 +484,7 @@ static void glui_frame(void)
|
|||||||
glui_draw_cursor(gl, menu->mouse.x, menu->mouse.y);
|
glui_draw_cursor(gl, menu->mouse.x, menu->mouse.y);
|
||||||
|
|
||||||
draw_text:
|
draw_text:
|
||||||
if (gl->font_driver->flush)
|
if (glui->use_blocks)
|
||||||
{
|
{
|
||||||
gl->font_driver->flush(gl->font_handle);
|
gl->font_driver->flush(gl->font_handle);
|
||||||
gl->font_driver->bind_block(gl->font_handle, NULL);
|
gl->font_driver->bind_block(gl->font_handle, NULL);
|
||||||
@ -516,6 +519,9 @@ static void *glui_init(void)
|
|||||||
glui = (glui_handle_t*)menu->userdata;
|
glui = (glui_handle_t*)menu->userdata;
|
||||||
glui->textures.bg.id = 0;
|
glui->textures.bg.id = 0;
|
||||||
|
|
||||||
|
if (gl->font_driver->bind_block && gl->font_driver->flush)
|
||||||
|
glui->use_blocks = true;
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
error:
|
error:
|
||||||
if (menu)
|
if (menu)
|
||||||
@ -532,7 +538,7 @@ static void glui_free(void *data)
|
|||||||
|
|
||||||
gl_coord_array_release(&glui->raster_block.carr);
|
gl_coord_array_release(&glui->raster_block.carr);
|
||||||
|
|
||||||
if (gl->font_driver->bind_block)
|
if (glui->use_blocks)
|
||||||
gl->font_driver->bind_block(gl->font_handle, NULL);
|
gl->font_driver->bind_block(gl->font_handle, NULL);
|
||||||
|
|
||||||
if (menu->alloc_font)
|
if (menu->alloc_font)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user