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:
parent
bc1293925a
commit
ae82b14e59
5 changed files with 72 additions and 9 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue