1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

LibGL: Implement glIsTexture

Required by Xash3D for the r_showtextures command, where it shows every
allocated texture on screen.

Description of glIsTexture from the spec:
"glIsTexture returns GL_TRUE if texture is currently the name of a
texture. If texture is zero, or is a non-zero value that is not
currently the name of a texture, or if an error occurs, glIsTexture
returns GL_FALSE.

A name returned by glGenTextures, but not yet associated with a texture
by calling glBindTexture, is not the name of a texture."

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glIsTexture.xhtml
This commit is contained in:
Luke Wilde 2022-01-13 06:02:33 +00:00 committed by Andreas Kling
parent adfb0846d2
commit 1fc611877f
5 changed files with 22 additions and 0 deletions

View file

@ -47,6 +47,11 @@ void glBindTexture(GLenum target, GLuint texture)
g_gl_context->gl_bind_texture(target, texture);
}
GLboolean glIsTexture(GLuint texture)
{
return g_gl_context->gl_is_texture(texture);
}
// Note: This is an _extremely_ misleading API name. This sets the active
// texture unit, NOT the active texture itself...
void glActiveTexture(GLenum texture)