summaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-05 10:12:55 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-05 10:12:55 -0500
commitdd3887ec47137b6bf993674356a73b3266bb8a51 (patch)
treec9981783a6574b58dd9f503384b2fe651495b224 /text.h
parent1e7e392b9d5e593aeb9680d82b76afddad8ce2e6 (diff)
got text working with modern OpenGL
Diffstat (limited to 'text.h')
-rw-r--r--text.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/text.h b/text.h
index f57fef9..0f0ba68 100644
--- a/text.h
+++ b/text.h
@@ -18,8 +18,8 @@ typedef struct {
float x, y;
// points at which the text should be cut off
float min_x, max_x, min_y, max_y;
- // color
- float r, g, b, a;
+ // [0] = r, [1] = g, [2] = b, [3] = a.
+ float color[4];
} TextRenderState;
typedef enum {
@@ -47,13 +47,13 @@ extern float text_font_char_height(Font *font);
// This is meant to be only used for monospace fonts.
extern float text_font_char_width(Font *font);
// Render some UTF-8 text to the screen (simple interface).
-extern void text_render(Font *font, char const *text, float x, float y);
+extern void text_render(Font *font, char const *text, float x, float y, u32 color);
// Get the dimensions of some text.
extern void text_get_size(Font *font, char const *text, float *width, float *height);
extern void text_get_size32(Font *font, char32_t const *text, u64 len, float *width, float *height);
// Write text, but using a state, starting at (x, y) -- state->x and state->y are ignored. This allows you to control min/max_x/y.
extern void text_render_with_state(Font *font, TextRenderState *state, char const *text, float x, float y);
-extern void text_render_anchored(Font *font, char const *text, float x, float y, Anchor anchor);
+extern void text_render_anchored(Font *font, char const *text, float x, float y, u32 color, Anchor anchor);
// Begin writing characters.
extern void text_chars_begin(Font *font);
// Finish writing characters.