From 3bdf82eec2c915e91ae487e29d72639f9efcad67 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 19 Oct 2021 07:04:21 +0200 Subject: Use uint8_t for color instead of float --- src/graphics/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/graphics/text.c') 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) { -- cgit v1.2.3