mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-25 04:06:18 +00:00
(gl_font_renderer_t) Add get_glyph() function pointer
This commit is contained in:
parent
0c1a2dd8d7
commit
81ff623957
@ -19,6 +19,8 @@
|
||||
#include "../../driver.h"
|
||||
#include "../../boolean.h"
|
||||
|
||||
struct font_glyph;
|
||||
|
||||
typedef struct gl_font_renderer
|
||||
{
|
||||
void *(*init)(void *data, const char *font_path, float font_size);
|
||||
@ -26,6 +28,8 @@ typedef struct gl_font_renderer
|
||||
void (*render_msg)(void *data, const char *msg,
|
||||
const struct font_params *parms);
|
||||
const char *ident;
|
||||
|
||||
const struct font_glyph *(*get_glyph)(void *data, uint32_t code);
|
||||
} gl_font_renderer_t;
|
||||
|
||||
extern gl_font_renderer_t gl_raster_font;
|
||||
|
@ -265,9 +265,20 @@ static void gl_render_msg(void *data, const char *msg,
|
||||
gl_set_viewport(gl, gl->win_width, gl->win_height, false, true);
|
||||
}
|
||||
|
||||
static const struct font_glyph *gl_get_glyph(void *data, uint32_t code)
|
||||
{
|
||||
gl_raster_t *font = (gl_raster_t*)data;
|
||||
|
||||
if (!font)
|
||||
return NULL;
|
||||
|
||||
return font->font_driver->get_glyph(font->font_driver, code);
|
||||
}
|
||||
|
||||
gl_font_renderer_t gl_raster_font = {
|
||||
gl_init_font,
|
||||
gl_free_font,
|
||||
gl_render_msg,
|
||||
"GL raster",
|
||||
gl_get_glyph,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user