diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-10-19 07:04:21 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-10-19 07:04:21 +0200 |
commit | 3bdf82eec2c915e91ae487e29d72639f9efcad67 (patch) | |
tree | c61476e241f75e71959394d82aa3ff9c343febbb /src/graphics/text.c | |
parent | 4a96d4a354fbde7fd614075c060aea78a3411b42 (diff) |
Use uint8_t for color instead of float
Diffstat (limited to 'src/graphics/text.c')
-rw-r--r-- | src/graphics/text.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/graphics/text.c b/src/graphics/text.c index 9afc204..0aa33cf 100644 --- a/src/graphics/text.c +++ b/src/graphics/text.c @@ -5,7 +5,7 @@ int mgl_text_init(mgl_text *self, mgl_font *font, const char *text, float x, float y) { self->font = font; self->text = text; - self->color = (mgl_color){ 1.0f, 1.0f, 1.0f, 1.0f }; + self->color = (mgl_color){ 255, 255, 255, 255 }; self->position = (mgl_vec2f){ x, y }; return 0; } @@ -44,7 +44,7 @@ void mgl_text_draw(mgl_context *context, mgl_text *text) { mgl_vec2f position = text->position; position.y += text->font->size; - context->gl.glColor4f(text->color.r, text->color.g, text->color.b, text->color.a); + context->gl.glColor4ub(text->color.r, text->color.g, text->color.b, text->color.a); context->gl.glBindTexture(GL_TEXTURE_2D, text->font->texture.id); context->gl.glBegin(GL_QUADS); while(*str) { |