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

LibGL+LibWeb: Remove WebGL-specific API from GLContext

The OpenGL API has ways to retrieve these values, so let's make sure to
implement them. :^)
This commit is contained in:
Jelle Raaijmakers 2022-12-25 00:45:33 +01:00 committed by Andreas Kling
parent bc1293925a
commit ae82b14e59
5 changed files with 72 additions and 9 deletions

View file

@ -52,9 +52,14 @@ void WebGLRenderingContextBase::present()
// This default behavior can be changed by setting the preserveDrawingBuffer attribute of the WebGLContextAttributes object.
// If this flag is true, the contents of the drawing buffer shall be preserved until the author either clears or overwrites them."
if (!m_context_creation_parameters.preserve_drawing_buffer) {
auto current_clear_color = m_context->current_clear_color();
auto current_clear_depth = m_context->current_clear_depth();
auto current_clear_stencil = m_context->current_clear_stencil();
Array<GLdouble, 4> current_clear_color;
m_context->gl_get_doublev(GL_COLOR_CLEAR_VALUE, current_clear_color.data());
GLdouble current_clear_depth;
m_context->gl_get_doublev(GL_DEPTH_CLEAR_VALUE, &current_clear_depth);
GLint current_clear_stencil;
m_context->gl_get_integerv(GL_STENCIL_CLEAR_VALUE, &current_clear_stencil);
// The implicit clear value for the color buffer is (0, 0, 0, 0)
m_context->gl_clear_color(0, 0, 0, 0);