diff --git a/gfx/fonts/freetype.c b/gfx/fonts/freetype.c index 1125d9acc9..fa3e3cb81a 100644 --- a/gfx/fonts/freetype.c +++ b/gfx/fonts/freetype.c @@ -220,18 +220,10 @@ static void calculate_font_coords(gl_t *gl, font_tex_coords[7] = hy; } -static void gl_render_msg_pre(gl_t *gl) -{ - gl_shader_use(0); - gl_set_viewport(gl, gl->win_width, gl->win_height, false, false); - glEnable(GL_BLEND); - (void)gl; -} - extern const GLfloat vertexes_flipped[]; extern const GLfloat white_color[]; -static void gl_render_msg_post(gl_t *gl) +void gl_render_msg_post(gl_t *gl) { // Go back to old rendering path. glTexCoordPointer(2, GL_FLOAT, 0, gl->tex_coords); @@ -250,7 +242,9 @@ void gl_render_msg(gl_t *gl, const char *msg) if (!gl->font) return; - gl_render_msg_pre(gl); + gl_shader_use(0); + gl_set_viewport(gl, gl->win_width, gl->win_height, false, false); + glEnable(GL_BLEND); GLfloat font_vertex[8]; GLfloat font_vertex_dark[8]; @@ -286,12 +280,9 @@ void gl_render_msg(gl_t *gl, const char *msg) glVertexPointer(2, GL_FLOAT, 0, font_vertex); glColorPointer(4, GL_FLOAT, 0, gl->font_color); glDrawArrays(GL_QUADS, 0, 4); - - gl_render_msg_post(gl); #else (void)gl; (void)msg; #endif } - diff --git a/gfx/fonts/ps3_libdbgfont.c b/gfx/fonts/ps3_libdbgfont.c index 445af60a56..3279d9fc0b 100644 --- a/gfx/fonts/ps3_libdbgfont.c +++ b/gfx/fonts/ps3_libdbgfont.c @@ -40,6 +40,10 @@ void gl_render_msg(gl_t *gl, const char *msg) { cellDbgFontPrintf(g_settings.video.msg_pos_x, g_settings.video.msg_pos_y, 1.11f, BLUE, msg); cellDbgFontPrintf(g_settings.video.msg_pos_x, g_settings.video.msg_pos_y, 1.10f, WHITE, msg); +} + +void gl_render_msg_post(gl_t *gl) +{ cellDbgFontDraw(); } diff --git a/gfx/gl.c b/gfx/gl.c index 48d1bdf071..16e2f4b86f 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -891,7 +891,10 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei gl_next_texture_index(gl, &tex_info); if (msg) + { gl_render_msg(gl, msg); + gl_render_msg_post(gl); + } gfx_ctx_update_window_title(false); gfx_ctx_swap_buffers(); diff --git a/gfx/gl_font.h b/gfx/gl_font.h index 9c512ecd35..cc74950e93 100644 --- a/gfx/gl_font.h +++ b/gfx/gl_font.h @@ -22,6 +22,7 @@ void gl_init_font(gl_t *gl, const char *font_path, unsigned font_size); void gl_deinit_font(gl_t *gl); void gl_render_msg(gl_t *gl, const char *msg); +void gl_render_msg_post(gl_t *gl); #endif