diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-04-24 18:11:22 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-08 10:13:22 +0200 |
commit | eff3c8a954dc5024792aaefe07e077337390bd64 (patch) | |
tree | 14672dc060150f6c0b7b0eaac160e0779219adac /Userland/Libraries/LibGL | |
parent | 193b53344a20d11d64b78775aaa2f69cc707967b (diff) | |
download | serenity-eff3c8a954dc5024792aaefe07e077337390bd64.zip |
LibGL: Implement glColor4(ub,f)v
Diffstat (limited to 'Userland/Libraries/LibGL')
-rw-r--r-- | Userland/Libraries/LibGL/GL/gl.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibGL/GLColor.cpp | 20 |
2 files changed, 24 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index 2b392d73ac..173c6186ee 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -74,6 +74,10 @@ GLAPI void glBegin(GLenum mode); GLAPI void glClear(GLbitfield mask); GLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); GLAPI void glColor3f(GLfloat r, GLfloat g, GLfloat b); +GLAPI void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); +GLAPI void glColor4fv(const GLfloat* v); +GLAPI void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a); +GLAPI void glColor4ubv(const GLubyte* v); GLAPI void glEnd(); GLAPI void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearVal, GLdouble farVal); GLAPI GLenum glGetError(); diff --git a/Userland/Libraries/LibGL/GLColor.cpp b/Userland/Libraries/LibGL/GLColor.cpp index f848b0890f..28b5772741 100644 --- a/Userland/Libraries/LibGL/GLColor.cpp +++ b/Userland/Libraries/LibGL/GLColor.cpp @@ -14,3 +14,23 @@ void glColor3f(GLfloat r, GLfloat g, GLfloat b) { g_gl_context->gl_color(r, g, b, 1.0); } + +void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a) +{ + g_gl_context->gl_color(r, g, b, a); +} + +void glColor4fv(const GLfloat* v) +{ + g_gl_context->gl_color(v[0], v[1], v[2], v[3]); +} + +void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a) +{ + g_gl_context->gl_color(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f); +} + +void glColor4ubv(const GLubyte* v) +{ + g_gl_context->gl_color(v[0] / 255.0f, v[1] / 255.0f, v[2] / 255.0f, v[3] / 255.0f); +} |