aboutsummaryrefslogtreecommitdiff
path: root/include/mgl/graphics/text.h
blob: bb07675e187493934754f9bb6731c48d40392819 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef MGL_TEXT_H
#define MGL_TEXT_H

#include "../system/vec.h"
#include "color.h"

typedef struct mgl_font mgl_font;
typedef struct mgl_context mgl_context;

typedef struct {
    mgl_font *font;
    const char *text;
    mgl_color color;
    mgl_vec2f position;
} mgl_text;

/* Note: keeps a reference to |text|. |text| needs to be valid as long as |self| is used. */
int mgl_text_init(mgl_text *self, mgl_font *font, const char *text, float x, float y);
void mgl_text_deinit(mgl_text *self);

void mgl_text_draw(mgl_context *context, mgl_text *text);

#endif /* MGL_TEXT_H */