From a29534b53165484f28d6c18c2994ca19933ebcc0 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 10 Jan 2022 02:07:07 +0100 Subject: [PATCH] LibGL: Implement `glColor3d` and `glColor3ubv` --- Userland/Libraries/LibGL/GL/gl.h | 2 ++ Userland/Libraries/LibGL/GLColor.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Userland/Libraries/LibGL/GL/gl.h b/Userland/Libraries/LibGL/GL/gl.h index 4b28fd927f6..6f119568dc1 100644 --- a/Userland/Libraries/LibGL/GL/gl.h +++ b/Userland/Libraries/LibGL/GL/gl.h @@ -451,10 +451,12 @@ GLAPI void glClear(GLbitfield mask); GLAPI void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); GLAPI void glClearDepth(GLdouble depth); GLAPI void glClearStencil(GLint s); +GLAPI void glColor3d(GLdouble r, GLdouble g, GLdouble b); GLAPI void glColor3dv(GLdouble const* v); GLAPI void glColor3f(GLfloat r, GLfloat g, GLfloat b); GLAPI void glColor3fv(const GLfloat* v); GLAPI void glColor3ub(GLubyte r, GLubyte g, GLubyte b); +GLAPI void glColor3ubv(GLubyte const* v); GLAPI void glColor4dv(GLdouble const* v); GLAPI void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a); GLAPI void glColor4fv(const GLfloat* v); diff --git a/Userland/Libraries/LibGL/GLColor.cpp b/Userland/Libraries/LibGL/GLColor.cpp index f6eac96a643..c620f014403 100644 --- a/Userland/Libraries/LibGL/GLColor.cpp +++ b/Userland/Libraries/LibGL/GLColor.cpp @@ -10,6 +10,11 @@ extern GL::GLContext* g_gl_context; +void glColor3d(GLdouble r, GLdouble g, GLdouble b) +{ + g_gl_context->gl_color(r, g, b, 1.0); +} + void glColor3dv(GLdouble const* v) { g_gl_context->gl_color(v[0], v[1], v[2], 1.0); @@ -30,6 +35,11 @@ void glColor3ub(GLubyte r, GLubyte g, GLubyte b) g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, 1.0); } +void glColor3ubv(GLubyte const* v) +{ + g_gl_context->gl_color(v[0] / 255.0f, v[1] / 255.0f, v[2] / 255.0f, 1.0); +} + void glColor4dv(GLdouble const* v) { g_gl_context->gl_color(v[0], v[1], v[2], v[3]);