GLTexture.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 "GLContext.h"
  8. #include <LibGL/GL/gl.h>
  9. extern GL::GLContext* g_gl_context;
  10. void glGenTextures(GLsizei n, GLuint* textures)
  11. {
  12. g_gl_context->gl_gen_textures(n, textures);
  13. }
  14. void glDeleteTextures(GLsizei n, const GLuint* textures)
  15. {
  16. g_gl_context->gl_delete_textures(n, textures);
  17. }
  18. void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* data)
  19. {
  20. g_gl_context->gl_tex_image_2d(target, level, internalFormat, width, height, border, format, type, data);
  21. }
  22. void glBindTexture(GLenum target, GLuint texture)
  23. {
  24. g_gl_context->gl_bind_texture(target, texture);
  25. }
  26. // Note: This is an _extremely_ misleading API name. This sets the active
  27. // texture unit, NOT the active texture itself...
  28. void glActiveTexture(GLenum texture)
  29. {
  30. g_gl_context->gl_active_texture(texture);
  31. }