1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 02:38:11 +00:00

LibGL: Implement GL_STENCIL_TEST

Only the state is implemented; not the rasterization phase.
This commit is contained in:
Jelle Raaijmakers 2021-12-01 14:57:54 +01:00 committed by Andreas Kling
parent 11fea6b597
commit 729349ce78
3 changed files with 14 additions and 0 deletions

View file

@ -574,6 +574,9 @@ void SoftwareGLContext::gl_enable(GLenum capability)
rasterizer_options.scissor_enabled = true;
update_rasterizer_options = true;
break;
case GL_STENCIL_TEST:
m_stencil_test_enabled = true;
break;
case GL_TEXTURE_1D:
m_active_texture_unit->set_texture_1d_enabled(true);
break;
@ -630,6 +633,9 @@ void SoftwareGLContext::gl_disable(GLenum capability)
rasterizer_options.scissor_enabled = false;
update_rasterizer_options = true;
break;
case GL_STENCIL_TEST:
m_stencil_test_enabled = false;
break;
case GL_TEXTURE_1D:
m_active_texture_unit->set_texture_1d_enabled(false);
break;
@ -669,6 +675,8 @@ GLboolean SoftwareGLContext::gl_is_enabled(GLenum capability)
return rasterizer_options.fog_enabled;
case GL_SCISSOR_TEST:
return rasterizer_options.scissor_enabled;
case GL_STENCIL_TEST:
return m_stencil_test_enabled;
}
RETURN_VALUE_WITH_ERROR_IF(true, GL_INVALID_ENUM, 0);
@ -1554,6 +1562,9 @@ void SoftwareGLContext::gl_get_booleanv(GLenum pname, GLboolean* data)
case GL_CULL_FACE:
*data = m_cull_faces ? GL_TRUE : GL_FALSE;
break;
case GL_STENCIL_TEST:
*data = m_stencil_test_enabled ? GL_TRUE : GL_FALSE;
break;
case GL_TEXTURE_1D:
*data = m_active_texture_unit->texture_1d_enabled() ? GL_TRUE : GL_FALSE;
break;