[Feat] (MG_Impl/Program): glAttachShader

This commit is contained in:
2025-08-11 15:50:24 +08:00
parent 4ec815a383
commit 429618a00a
3 changed files with 27 additions and 3 deletions
+13 -1
View File
@@ -57,7 +57,19 @@ namespace MobileGL {
}
void AttachShader_State(GLuint program, GLuint shader) {
THROW_UNIMPL_EXCEPTION;
auto programObject = TryToGetProgramObject(program);
if (!programObject)
return;
auto shaderObject = TryToGetShaderObject(shader);
if (!shaderObject)
return;
if (!programObject->AttachShader(shaderObject)) {
MG_State::pGLContext->RecordError(
ErrorCode::InvalidOperation,
MakeShared<GenericErrorInfo>("MG_Impl/GLImpl", __func__,
"`shader` is already attached to `program`."));
return;
}
}
void BindAttribLocation_State(GLuint program, GLuint index, const GLchar* name) {