GLColor.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 glColor3d(GLdouble r, GLdouble g, GLdouble b)
  11. {
  12. g_gl_context->gl_color(r, g, b, 1.0);
  13. }
  14. void glColor3dv(GLdouble const* v)
  15. {
  16. g_gl_context->gl_color(v[0], v[1], v[2], 1.0);
  17. }
  18. void glColor3f(GLfloat r, GLfloat g, GLfloat b)
  19. {
  20. g_gl_context->gl_color(r, g, b, 1.0);
  21. }
  22. void glColor3fv(const GLfloat* v)
  23. {
  24. g_gl_context->gl_color(v[0], v[1], v[2], 1.0);
  25. }
  26. void glColor3ub(GLubyte r, GLubyte g, GLubyte b)
  27. {
  28. g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, 1.0);
  29. }
  30. void glColor3ubv(GLubyte const* v)
  31. {
  32. g_gl_context->gl_color(v[0] / 255.0f, v[1] / 255.0f, v[2] / 255.0f, 1.0);
  33. }
  34. void glColor4dv(GLdouble const* v)
  35. {
  36. g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
  37. }
  38. void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
  39. {
  40. g_gl_context->gl_color(r, g, b, a);
  41. }
  42. void glColor4fv(const GLfloat* v)
  43. {
  44. g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
  45. }
  46. void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
  47. {
  48. g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
  49. }
  50. void glColor4ubv(const GLubyte* v)
  51. {
  52. g_gl_context->gl_color(v[0] / 255.0f, v[1] / 255.0f, v[2] / 255.0f, v[3] / 255.0f);
  53. }