Additional debug string rendering infrastructure

Separate notion of rendering a static string, i.e. for debug display that
is absolutely positioned, and rendering of a regular string that moves
with the game camera.
This commit is contained in:
2016-07-12 18:11:31 +10:00
parent d82afe49d0
commit b1875077b7
6 changed files with 149 additions and 55 deletions
+1
View File
@@ -19,6 +19,7 @@ enum EntityType
entitytype_null,
entitytype_hero,
entitytype_npc,
entitytype_mob,
entitytype_tile,
entitytype_count,
};
+11 -2
View File
@@ -19,8 +19,17 @@ typedef struct RenderQuad
v4 vertex[4];
} RenderQuad;
void renderer_string(Renderer *const renderer, Font *const font,
const char *const string, v2 pos, f32 rotate, v4 color);
void renderer_string(Renderer *const renderer, v4 cameraBounds,
Font *const font, const char *const string, v2 pos,
f32 rotate, v4 color);
inline void renderer_staticString(Renderer *const renderer, Font *const font,
const char *const string, v2 pos, f32 rotate,
v4 color)
{
renderer_string(renderer, V4(0, renderer->size.h, renderer->size.w, 0),
font, string, pos, rotate, color);
}
void renderer_entity(Renderer *renderer, v4 cameraBounds, Entity *entity,
f32 dt, f32 rotate, v4 color);