mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-15 15:42:52 +00:00
This currently only implements a subset of this function. Namely setting wrap, mag and min modes for the GL_TETXURE_2D target.
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
|
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
|
*
|
|
* 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);
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
void glBindTexture(GLenum target, GLuint texture)
|
|
{
|
|
g_gl_context->gl_bind_texture(target, texture);
|
|
}
|
|
|
|
// 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);
|
|
}
|
|
|
|
void glTexParameteri(GLenum target, GLenum pname, GLint param)
|
|
{
|
|
g_gl_context->gl_tex_parameter(target, pname, param);
|
|
}
|
|
|
|
void glTexParameterf(GLenum target, GLenum pname, GLfloat param)
|
|
{
|
|
g_gl_context->gl_tex_parameter(target, pname, param);
|
|
}
|