RetroArch
Classes | Macros | Functions | Variables
gl_raster_font.c File Reference
#include <stdlib.h>
#include <encodings/utf.h>
#include <string/stdstring.h>
#include <retro_math.h>
#include "../common/gl_common.h"
#include "../font_driver.h"
#include "../video_driver.h"
Include dependency graph for gl_raster_font.c:

Classes

struct  gl_raster_t
 

Macros

#define gl_raster_font_emit(c, vx, vy)
 
#define MAX_MSG_LEN_CHUNK   64
 

Functions

static void gl_raster_font_free_font (void *data, bool is_threaded)
 
static bool gl_raster_font_upload_atlas (gl_raster_t *font)
 
static voidgl_raster_font_init_font (void *data, const char *font_path, float font_size, bool is_threaded)
 
static int gl_get_message_width (void *data, const char *msg, unsigned msg_len, float scale)
 
static void gl_raster_font_draw_vertices (gl_raster_t *font, const video_coords_t *coords, video_frame_info_t *video_info)
 
static void gl_raster_font_render_line (gl_raster_t *font, const char *msg, unsigned msg_len, GLfloat scale, const GLfloat color[4], GLfloat pos_x, GLfloat pos_y, unsigned text_align, video_frame_info_t *video_info)
 
static void gl_raster_font_render_message (gl_raster_t *font, const char *msg, GLfloat scale, const GLfloat color[4], GLfloat pos_x, GLfloat pos_y, unsigned text_align, video_frame_info_t *video_info)
 
static void gl_raster_font_setup_viewport (unsigned width, unsigned height, gl_raster_t *font, bool full_screen)
 
static void gl_raster_font_render_msg (video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params)
 
static const struct font_glyphgl_raster_font_get_glyph (void *data, uint32_t code)
 
static void gl_raster_font_flush_block (unsigned width, unsigned height, void *data, video_frame_info_t *video_info)
 
static void gl_raster_font_bind_block (void *data, void *userdata)
 

Variables

font_renderer_t gl_raster_font
 

Macro Definition Documentation

◆ gl_raster_font_emit

#define gl_raster_font_emit (   c,
  vx,
  vy 
)
Value:
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) + 1] = (y + (delta_y - off_y - vy * height) * scale) * inv_win_height; \
font_tex_coords[ 2 * (6 * i + c) + 0] = (tex_x + vx * width) * inv_tex_size_x; \
font_tex_coords[ 2 * (6 * i + c) + 1] = (tex_y + vy * height) * inv_tex_size_y; \
font_color[ 4 * (6 * i + c) + 0] = color[0]; \
font_color[ 4 * (6 * i + c) + 1] = color[1]; \
font_color[ 4 * (6 * i + c) + 2] = color[2]; \
font_color[ 4 * (6 * i + c) + 3] = color[3]; \
font_lut_tex_coord[ 2 * (6 * i + c) + 0] = gl->coords.lut_tex_coord[0]; \
font_lut_tex_coord[ 2 * (6 * i + c) + 1] = gl->coords.lut_tex_coord[1]; \
} while(0)
struct video_coords coords
Definition: gl_common.h:312
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9939
const GLubyte * c
Definition: glext.h:9812
GLint GLint GLint GLint GLint GLint y
Definition: glext.h:6295
GLint GLint GLint GLint GLint x
Definition: glext.h:6295
GLuint color
Definition: glext.h:6883
Definition: gl_common.h:236
GLint GLint GLsizei width
Definition: glext.h:6293
const float * lut_tex_coord
Definition: video_coord_array.h:61
GLint GLint GLsizei GLsizei height
Definition: glext.h:6293

◆ MAX_MSG_LEN_CHUNK

#define MAX_MSG_LEN_CHUNK   64

Function Documentation

◆ gl_get_message_width()

static int gl_get_message_width ( void data,
const char *  msg,
unsigned  msg_len,
float  scale 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_raster_font_bind_block()

static void gl_raster_font_bind_block ( void data,
void userdata 
)
static

◆ gl_raster_font_draw_vertices()

static void gl_raster_font_draw_vertices ( gl_raster_t font,
const video_coords_t coords,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_raster_font_flush_block()

static void gl_raster_font_flush_block ( unsigned  width,
unsigned  height,
void data,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:

◆ gl_raster_font_free_font()

static void gl_raster_font_free_font ( void data,
bool  is_threaded 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_raster_font_get_glyph()

static const struct font_glyph* gl_raster_font_get_glyph ( void data,
uint32_t  code 
)
static

◆ gl_raster_font_init_font()

static void* gl_raster_font_init_font ( void data,
const char *  font_path,
float  font_size,
bool  is_threaded 
)
static
Here is the call graph for this function:

◆ gl_raster_font_render_line()

static void gl_raster_font_render_line ( gl_raster_t font,
const char *  msg,
unsigned  msg_len,
GLfloat  scale,
const GLfloat  color[4],
GLfloat  pos_x,
GLfloat  pos_y,
unsigned  text_align,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_raster_font_render_message()

static void gl_raster_font_render_message ( gl_raster_t font,
const char *  msg,
GLfloat  scale,
const GLfloat  color[4],
GLfloat  pos_x,
GLfloat  pos_y,
unsigned  text_align,
video_frame_info_t video_info 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_raster_font_render_msg()

static void gl_raster_font_render_msg ( video_frame_info_t video_info,
void data,
const char *  msg,
const struct font_params params 
)
static
Here is the call graph for this function:

◆ gl_raster_font_setup_viewport()

static void gl_raster_font_setup_viewport ( unsigned  width,
unsigned  height,
gl_raster_t font,
bool  full_screen 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ gl_raster_font_upload_atlas()

static bool gl_raster_font_upload_atlas ( gl_raster_t font)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gl_raster_font

font_renderer_t gl_raster_font
Initial value:
= {
"GL raster",
}
static void * gl_raster_font_init_font(void *data, const char *font_path, float font_size, bool is_threaded)
Definition: gl_raster_font.c:170
static int gl_get_message_width(void *data, const char *msg, unsigned msg_len, float scale)
Definition: gl_raster_font.c:218
static void gl_raster_font_free_font(void *data, bool is_threaded)
Definition: gl_raster_font.c:58
static void gl_raster_font_bind_block(void *data, void *userdata)
Definition: gl_raster_font.c:547
static void gl_raster_font_render_msg(video_frame_info_t *video_info, void *data, const char *msg, const struct font_params *params)
Definition: gl_raster_font.c:416
static const struct font_glyph * gl_raster_font_get_glyph(void *data, uint32_t code)
Definition: gl_raster_font.c:512
static void gl_raster_font_flush_block(unsigned width, unsigned height, void *data, video_frame_info_t *video_info)
Definition: gl_raster_font.c:524