1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-15 21:04:59 +00:00
serenity/Userland/Libraries/LibGL/GLColor.cpp
2021-05-08 10:13:22 +02:00

36 lines
815 B
C++

/*
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@gmx.de>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "GL/gl.h"
#include "GLContext.h"
extern GL::GLContext* g_gl_context;
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);
}