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

LibGL+LibSoftGPU: Add GL_MAX_LIGHTS to get_context_parameter

This is required to allow lighting to work properly in the GL. We
currently have the maximum number of lights in the software GL context
set to 8, as this is the minimum that OpenGL mandates according to the
spec.
This commit is contained in:
Jesse Buhagiar 2022-01-07 22:32:32 +11:00 committed by Linus Groh
parent 9ec2b379a4
commit 192befa84b
5 changed files with 7 additions and 1 deletions

View file

@ -98,6 +98,8 @@ Optional<ContextParameter> SoftwareGLContext::get_context_parameter(GLenum name)
return ContextParameter { .type = GL_INT, .value = { .integer_value = sizeof(float) * 8 } };
case GL_LIGHTING:
return ContextParameter { .type = GL_BOOL, .is_capability = true, .value = { .boolean_value = m_lighting_enabled } };
case GL_MAX_LIGHTS:
return ContextParameter { .type = GL_INT, .value = { .integer_value = static_cast<GLint>(m_device_info.num_lights) } };
case GL_MAX_MODELVIEW_STACK_DEPTH:
return ContextParameter { .type = GL_INT, .value = { .integer_value = MODELVIEW_MATRIX_STACK_LIMIT } };
case GL_MAX_PROJECTION_STACK_DEPTH: