GLColor.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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.0, v[1] / 255.0, v[2] / 255.0, 1.0);
  33. }
  34. void glColor4b(GLbyte r, GLbyte g, GLbyte b, GLbyte a)
  35. {
  36. g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
  37. }
  38. void glColor4dv(GLdouble const* v)
  39. {
  40. g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
  41. }
  42. void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
  43. {
  44. g_gl_context->gl_color(r, g, b, a);
  45. }
  46. void glColor4fv(const GLfloat* v)
  47. {
  48. g_gl_context->gl_color(v[0], v[1], v[2], v[3]);
  49. }
  50. void glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
  51. {
  52. g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
  53. }
  54. void glColor4ubv(const GLubyte* v)
  55. {
  56. g_gl_context->gl_color(v[0] / 255.0, v[1] / 255.0, v[2] / 255.0, v[3] / 255.0);
  57. }