diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-12-25 00:45:33 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-25 15:48:59 +0100 |
commit | ae82b14e59dfbe0996559320aa6f9bb76066a4cf (patch) | |
tree | 9828ebe95332ba2d72ccc7f63d18c1486c22a51a /Userland/Libraries/LibWeb | |
parent | bc1293925a271976f0646c6741e402db1f48d2fd (diff) | |
download | serenity-ae82b14e59dfbe0996559320aa6f9bb76066a4cf.zip |
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. :^)
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp index 402c079048..b501b04084 100644 --- a/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp +++ b/Userland/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.cpp @@ -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, ¤t_clear_depth); + + GLint current_clear_stencil; + m_context->gl_get_integerv(GL_STENCIL_CLEAR_VALUE, ¤t_clear_stencil); // The implicit clear value for the color buffer is (0, 0, 0, 0) m_context->gl_clear_color(0, 0, 0, 0); |