GLColor.cpp 823 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
  3. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #include "GL/gl.h"
  8. #include "GLContext.h"
  9. extern GL::GLContext* g_gl_context;
  10. void glColor3f(GLfloat r, GLfloat g, GLfloat b)
  11. {
  12. g_gl_context->gl_color(r, g, b, 1.0);
  13. }
  14. void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
  15. {
  16. g_gl_context->gl_color(r, g, b, a);
  17. }
  18. void glColor4fv(const GLfloat* v)
  19. {
  20. g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
  21. }
  22. void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
  23. {
  24. g_gl_context->gl_color(r / 255.0f, g / 255.0f, b / 255.0f, a / 255.0f);
  25. }
  26. void glColor4ubv(const GLubyte* v)
  27. {
  28. g_gl_context->gl_color(v[0] / 255.0f, v[1] / 255.0f, v[2] / 255.0f, v[3] / 255.0f);
  29. }