mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Feat] (MG_Impl/Program): glAttachShader
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user