1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibGL: Implement glGetIntegerv

This commit is contained in:
Jesse Buhagiar 2021-08-17 18:58:21 +10:00 committed by Andreas Kling
parent 0b67369830
commit 8ad42e6771
5 changed files with 28 additions and 0 deletions

View file

@ -1416,6 +1416,24 @@ void SoftwareGLContext::gl_get_booleanv(GLenum pname, GLboolean* data)
}
}
void SoftwareGLContext::gl_get_integerv(GLenum pname, GLint* data)
{
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
switch (pname) {
case GL_BLEND_SRC_ALPHA:
*data = m_blend_source_factor;
break;
case GL_BLEND_DST_ALPHA:
*data = m_blend_destination_factor;
break;
default:
// According to the Khronos docs, we always return GL_INVALID_ENUM if we encounter a non-accepted value
// for `pname`
RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM);
}
}
void SoftwareGLContext::gl_depth_mask(GLboolean flag)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_depth_mask, flag);