[Feat] (MG_State/Program): glShaderSource, glUseProgram

This commit is contained in:
2025-08-11 16:47:18 +08:00
parent 7517711308
commit 21a46ee151
7 changed files with 49 additions and 2 deletions
@@ -33,6 +33,14 @@ namespace MobileGL {
return CheckIndexAvail(program, m_programObjects) && m_programObjects[program] != nullptr;
}
void ProgramState::UseProgram(Uint program) {
if (program == 0)
m_currentProgram.reset();
if (!CheckIndexAvail(program, m_programObjects)) return;
m_currentProgram = m_programObjects[program];
}
Uint ProgramState::CreateShader(ShaderStage stage) {
Uint shaderId = 0;
m_shaderIndexGenerator.Generate(1, &shaderId);