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 /include | |
parent | 4a96d4a354fbde7fd614075c060aea78a3411b42 (diff) |
Use uint8_t for color instead of float
Diffstat (limited to 'include')
-rw-r--r-- | include/mgl/gl.h | 4 | ||||
-rw-r--r-- | include/mgl/graphics/color.h | 4 |
2 files changed, 5 insertions, 3 deletions
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 <stdint.h> 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 <stdint.h> + typedef struct { - float r, g, b, a; + uint8_t r, g, b, a; } mgl_color; #endif /* MGL_COLOR_H */ |