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

LibGL: Implement glClearStencil

This commit is contained in:
Jelle Raaijmakers 2021-12-01 16:20:22 +01:00 committed by Andreas Kling
parent 07bf37be75
commit 9c9fa33495
5 changed files with 27 additions and 2 deletions

View file

@ -84,6 +84,8 @@ void SoftwareGLContext::gl_clear(GLbitfield mask)
if (mask & GL_DEPTH_BUFFER_BIT)
m_rasterizer.clear_depth(static_cast<float>(m_clear_depth));
// FIXME: implement GL_STENCIL_BUFFER_BIT
}
void SoftwareGLContext::gl_clear_color(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
@ -104,6 +106,17 @@ void SoftwareGLContext::gl_clear_depth(GLdouble depth)
m_clear_depth = depth;
}
void SoftwareGLContext::gl_clear_stencil(GLint s)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_clear_stencil, s);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
// FIXME: "s is masked with 2^m - 1 , where m is the number of bits in the stencil buffer"
m_clear_stencil = s;
}
void SoftwareGLContext::gl_color(GLdouble r, GLdouble g, GLdouble b, GLdouble a)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_color, r, g, b, a);