2021-05-10 07:52:39 +10:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
2021-05-30 00:15:51 +02:00
|
|
|
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
2021-05-10 07:52:39 +10:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "GLContext.h"
|
|
|
|
|
#include <LibGL/GL/gl.h>
|
|
|
|
|
|
|
|
|
|
extern GL::GLContext* g_gl_context;
|
|
|
|
|
|
|
|
|
|
void glGenTextures(GLsizei n, GLuint* textures)
|
|
|
|
|
{
|
|
|
|
|
g_gl_context->gl_gen_textures(n, textures);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void glDeleteTextures(GLsizei n, const GLuint* textures)
|
|
|
|
|
{
|
|
|
|
|
g_gl_context->gl_delete_textures(n, textures);
|
|
|
|
|
}
|
2021-05-13 22:18:17 +10:00
|
|
|
|
|
|
|
|
void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* data)
|
|
|
|
|
{
|
|
|
|
|
g_gl_context->gl_tex_image_2d(target, level, internalFormat, width, height, border, format, type, data);
|
|
|
|
|
}
|
2021-05-30 00:15:51 +02:00
|
|
|
|
|
|
|
|
void glBindTexture(GLenum target, GLuint texture)
|
|
|
|
|
{
|
|
|
|
|
g_gl_context->gl_bind_texture(target, texture);
|
|
|
|
|
}
|
2021-05-30 16:56:56 +10:00
|
|
|
|
|
|
|
|
// Note: This is an _extremely_ misleading API name. This sets the active
|
|
|
|
|
// texture unit, NOT the active texture itself...
|
|
|
|
|
void glActiveTexture(GLenum texture)
|
|
|
|
|
{
|
|
|
|
|
g_gl_context->gl_active_texture(texture);
|
|
|
|
|
}
|