mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
LibGL: Implement glUseProgram
This commit is contained in:
parent
1812a169b8
commit
69171e7a05
4 changed files with 25 additions and 0 deletions
|
@ -118,4 +118,21 @@ void GLContext::gl_link_program(GLuint program)
|
|||
(void)program_it->value->link();
|
||||
}
|
||||
|
||||
void GLContext::gl_use_program(GLuint program)
|
||||
{
|
||||
if (program == 0) {
|
||||
m_current_program = nullptr;
|
||||
return;
|
||||
}
|
||||
|
||||
auto it = m_allocated_programs.find(program);
|
||||
|
||||
// FIXME: implement check "GL_INVALID_VALUE is generated if program is not a value generated by OpenGL."
|
||||
RETURN_WITH_ERROR_IF(it == m_allocated_programs.end(), GL_INVALID_OPERATION);
|
||||
// FIXME: implement check "GL_INVALID_OPERATION is generated if transform feedback mode is active."
|
||||
RETURN_WITH_ERROR_IF(it->value->link_status() != true, GL_INVALID_OPERATION);
|
||||
|
||||
m_current_program = it->value;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue