GLUtils.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 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. }
  50. void glFlush()
  51. {
  52. g_gl_context->gl_flush();
  53. }
  54. void glFinish()
  55. {
  56. g_gl_context->gl_finish();
  57. }
  58. void glHint(GLenum target, GLenum mode)
  59. {
  60. g_gl_context->gl_hint(target, mode);
  61. }
  62. void glReadBuffer(GLenum mode)
  63. {
  64. g_gl_context->gl_read_buffer(mode);
  65. }
  66. void glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
  67. {
  68. g_gl_context->gl_read_pixels(x, y, width, height, format, type, pixels);
  69. }
  70. void glGetFloatv(GLenum pname, GLfloat* params)
  71. {
  72. g_gl_context->gl_get_floatv(pname, params);
  73. }
  74. void glDepthMask(GLboolean flag)
  75. {
  76. g_gl_context->gl_depth_mask(flag);
  77. }