GLUtils.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
  3. * Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@gmx.de>
  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 glEnable(GLenum cap)
  11. {
  12. g_gl_context->gl_enable(cap);
  13. }
  14. void glDisable(GLenum cap)
  15. {
  16. g_gl_context->gl_disable(cap);
  17. }
  18. void glFrontFace(GLenum mode)
  19. {
  20. g_gl_context->gl_front_face(mode);
  21. }
  22. void glCullFace(GLenum mode)
  23. {
  24. g_gl_context->gl_cull_face(mode);
  25. }
  26. void glClear(GLbitfield mask)
  27. {
  28. g_gl_context->gl_clear(mask);
  29. }
  30. void glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
  31. {
  32. g_gl_context->gl_clear_color(red, green, blue, alpha);
  33. }
  34. void glClearDepth(GLdouble depth)
  35. {
  36. g_gl_context->gl_clear_depth(depth);
  37. }
  38. GLubyte* glGetString(GLenum name)
  39. {
  40. return g_gl_context->gl_get_string(name);
  41. }
  42. void glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
  43. {
  44. g_gl_context->gl_viewport(x, y, width, height);
  45. }
  46. GLenum glGetError()
  47. {
  48. return g_gl_context->gl_get_error();
  49. }