[renderer] Add stubs for Draw_FontString

Draw_FontString is for font-based text rendering. Nothing is implemented
at this stage.
This commit is contained in:
Bill Currie 2022-09-02 11:38:09 +09:00
parent 599c09e77e
commit 73635d84bf
14 changed files with 46 additions and 0 deletions

View file

@ -56,6 +56,7 @@ void gl_Draw_Picf (float x, float y, struct qpic_s *pic);
void gl_Draw_SubPic(int x, int y, struct qpic_s *pic, void gl_Draw_SubPic(int x, int y, struct qpic_s *pic,
int srcx, int srcy, int width, int height); int srcx, int srcy, int width, int height);
void gl_Draw_AddFont (struct rfont_s *font); void gl_Draw_AddFont (struct rfont_s *font);
void gl_Draw_FontString (int x, int y, const char *str);
void GL_Set2D (void); void GL_Set2D (void);
void GL_Set2DScaled (void); void GL_Set2DScaled (void);

View file

@ -56,6 +56,7 @@ void glsl_Draw_Picf (float x, float y, struct qpic_s *pic);
void glsl_Draw_SubPic(int x, int y, struct qpic_s *pic, void glsl_Draw_SubPic(int x, int y, struct qpic_s *pic,
int srcx, int srcy, int width, int height); int srcx, int srcy, int width, int height);
void glsl_Draw_AddFont (struct rfont_s *font); void glsl_Draw_AddFont (struct rfont_s *font);
void glsl_Draw_FontString (int x, int y, const char *str);
void GLSL_Set2D (void); void GLSL_Set2D (void);
void GLSL_Set2DScaled (void); void GLSL_Set2DScaled (void);

View file

@ -73,6 +73,8 @@ void Vulkan_Draw_SubPic(int x, int y, struct qpic_s *pic,
int srcx, int srcy, int width, int height, int srcx, int srcy, int width, int height,
struct vulkan_ctx_s *ctx); struct vulkan_ctx_s *ctx);
void Vulkan_Draw_AddFont (struct rfont_s *font, struct vulkan_ctx_s *ctx); void Vulkan_Draw_AddFont (struct rfont_s *font, struct vulkan_ctx_s *ctx);
void Vulkan_Draw_FontString (int x, int y, const char *str,
struct vulkan_ctx_s *ctx);
void Vulkan_Set2D (struct vulkan_ctx_s *ctx); void Vulkan_Set2D (struct vulkan_ctx_s *ctx);
void Vulkan_Set2DScaled (struct vulkan_ctx_s *ctx); void Vulkan_Set2DScaled (struct vulkan_ctx_s *ctx);

View file

@ -246,6 +246,7 @@ void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int h
struct rfont_s; struct rfont_s;
void Draw_AddFont (struct rfont_s *font); void Draw_AddFont (struct rfont_s *font);
void Draw_FontString (int x, int y, const char *str);
///@} ///@}

View file

@ -105,6 +105,7 @@ typedef struct vid_render_funcs_s {
void (*Draw_Picf) (float x, float y, qpic_t *pic); void (*Draw_Picf) (float x, float y, qpic_t *pic);
void (*Draw_SubPic) (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height); void (*Draw_SubPic) (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height);
void (*Draw_AddFont) (struct rfont_s *font); void (*Draw_AddFont) (struct rfont_s *font);
void (*Draw_FontString) (int x, int y, const char *str);
struct psystem_s *(*ParticleSystem) (void); struct psystem_s *(*ParticleSystem) (void);

View file

@ -1023,3 +1023,8 @@ void
gl_Draw_AddFont (struct rfont_s *font) gl_Draw_AddFont (struct rfont_s *font)
{ {
} }
void
gl_Draw_FontString (int x, int y, const char *str)
{
}

View file

@ -846,3 +846,8 @@ void
glsl_Draw_AddFont (struct rfont_s *font) glsl_Draw_AddFont (struct rfont_s *font)
{ {
} }
void
glsl_Draw_FontString (int x, int y, const char *str)
{
}

View file

@ -346,6 +346,15 @@ bi_Font_Load (progs_t *pr, void *_res)
r_funcs->Draw_AddFont (font); r_funcs->Draw_AddFont (font);
} }
static void
bi_Font_String (progs_t *pr, void *_res)
{
int x = P_INT (pr, 0);
int y = P_INT (pr, 1);
const char *str = P_GSTRING (pr, 2);
r_funcs->Draw_FontString (x, y, str);
}
static const char * static const char *
bi_draw_get_key (const void *p, void *unused) bi_draw_get_key (const void *p, void *unused)
{ {
@ -397,6 +406,7 @@ static builtin_t builtins[] = {
bi(Draw_Crosshair, 5, p(int), p(int), p(int), p(int)), bi(Draw_Crosshair, 5, p(int), p(int), p(int), p(int)),
bi(Font_Load, 3, p(string), p(int), p(ptr)), bi(Font_Load, 3, p(string), p(int), p(ptr)),
bi(Font_String, 3, p(int), p(int), p(string)),
{0} {0}
}; };

View file

@ -979,3 +979,8 @@ void
Draw_AddFont (struct rfont_s *font) Draw_AddFont (struct rfont_s *font)
{ {
} }
void
Draw_FontString (int x, int y, const char *str)
{
}

View file

@ -508,6 +508,7 @@ vid_render_funcs_t gl_vid_render_funcs = {
gl_Draw_Picf, gl_Draw_Picf,
gl_Draw_SubPic, gl_Draw_SubPic,
gl_Draw_AddFont, gl_Draw_AddFont,
gl_Draw_FontString,
gl_ParticleSystem, gl_ParticleSystem,
gl_R_Init, gl_R_Init,

View file

@ -452,6 +452,7 @@ vid_render_funcs_t glsl_vid_render_funcs = {
glsl_Draw_Picf, glsl_Draw_Picf,
glsl_Draw_SubPic, glsl_Draw_SubPic,
glsl_Draw_AddFont, glsl_Draw_AddFont,
glsl_Draw_FontString,
glsl_ParticleSystem, glsl_ParticleSystem,
glsl_R_Init, glsl_R_Init,

View file

@ -472,6 +472,7 @@ vid_render_funcs_t sw_vid_render_funcs = {
Draw_Picf, Draw_Picf,
Draw_SubPic, Draw_SubPic,
Draw_AddFont, Draw_AddFont,
Draw_FontString,
sw_ParticleSystem, sw_ParticleSystem,
sw_R_Init, sw_R_Init,

View file

@ -267,6 +267,12 @@ vulkan_Draw_AddFont (struct rfont_s *font)
Vulkan_Draw_AddFont (font, vulkan_ctx); Vulkan_Draw_AddFont (font, vulkan_ctx);
} }
static void
vulkan_Draw_FontString (int x, int y, const char *str)
{
Vulkan_Draw_FontString (x, y, str, vulkan_ctx);
}
static void static void
vulkan_begin_frame (void) vulkan_begin_frame (void)
{ {
@ -756,6 +762,7 @@ vid_render_funcs_t vulkan_vid_render_funcs = {
vulkan_Draw_Picf, vulkan_Draw_Picf,
vulkan_Draw_SubPic, vulkan_Draw_SubPic,
vulkan_Draw_AddFont, vulkan_Draw_AddFont,
vulkan_Draw_FontString,
vulkan_ParticleSystem, vulkan_ParticleSystem,
vulkan_R_Init, vulkan_R_Init,

View file

@ -972,3 +972,8 @@ Vulkan_Draw_AddFont (rfont_t *font, vulkan_ctx_t *ctx)
dctx->font_tex = Vulkan_LoadTex (ctx, &tex, 0, "draw.font"); dctx->font_tex = Vulkan_LoadTex (ctx, &tex, 0, "draw.font");
} }
} }
void
Vulkan_Draw_FontString (int x, int y, const char *str, vulkan_ctx_t *ctx)
{
}