From b7d5de7ce08ed72724c074bde70a906d24ee3675 Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Wed, 13 Aug 2025 21:58:03 +0800 Subject: [PATCH] [Feat] (MG_Impl/Texture): Implement IsTexture, ActiveTexture. --- MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp index 4a675fe6..7f096abd 100644 --- a/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp +++ b/MobileGL/MG_Impl/GLImpl/Texture/GL_Texture.cpp @@ -61,8 +61,8 @@ namespace MobileGL { } GLboolean IsTexture_State(GLuint texture) { - // TODO: implement - return GL_FALSE; + if (!TextureImpl::ValidateTextureName(texture)) return GL_FALSE; + return MG_State::pGLContext->ValidateTextureObject(texture) ? GL_TRUE : GL_FALSE; } void GetTexParameterIuiv_State(GLenum target, GLenum pname, GLuint* params) { @@ -212,7 +212,16 @@ namespace MobileGL { } void ActiveTexture_State(GLenum texture) { - // TODO: implement + if (texture < GL_TEXTURE0 || texture > GL_TEXTURE31) { + MG_State::pGLContext->RecordError( + ErrorCode::InvalidEnum, + MakeShared( + "MG_Impl/GLImpl", "ActiveTexture_State", + "Texture must be one of GL_TEXTUREi, where i is in the range 0 to 31.")); + return; + } + + MG_State::pGLContext->SetActiveTextureUnit(texture - GL_TEXTURE0); } /* @INSERTION_POINT:FUNCTION_IMPLEMENTATION@ */