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 --- include/mgl/gl.h | 4 ++-- include/mgl/graphics/color.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/mgl/gl.h b/include/mgl/gl.h index 36b2743..6de98d9 100644 --- a/include/mgl/gl.h +++ b/include/mgl/gl.h @@ -2,6 +2,7 @@ #define MGL_GL_H #include "gl_macro.h" +#include typedef struct _XVisualInfo _XVisualInfo; typedef struct _XDisplay Display; @@ -31,9 +32,8 @@ typedef struct { void (*glHint)(unsigned int target, unsigned int mode); void (*glBegin)(unsigned int mode); void (*glEnd)(void); - void (*glColor3f)(float red, float green, float blue); void (*glVertex3f)(float x, float y, float z); - void (*glColor4f)(float red, float green, float blue, float alpha); + void (*glColor4ub)(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); void (*glTexCoord2f)(float s, float t); void (*glOrtho)(double left, double right, double bottom, double top, double near_val, double far_val); void (*glMatrixMode)(unsigned int mode); diff --git a/include/mgl/graphics/color.h b/include/mgl/graphics/color.h index 62ded72..68cc0c1 100644 --- a/include/mgl/graphics/color.h +++ b/include/mgl/graphics/color.h @@ -1,8 +1,10 @@ #ifndef MGL_COLOR_H #define MGL_COLOR_H +#include + typedef struct { - float r, g, b, a; + uint8_t r, g, b, a; } mgl_color; #endif /* MGL_COLOR_H */ -- cgit v1.2.3