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

LibWeb: Add ability to present LibGL framebuffer and add clearing

This commit is contained in:
Luke Wilde 2022-06-04 04:27:48 +01:00 committed by Linus Groh
parent 68d9d4e247
commit 076c9772a4
8 changed files with 131 additions and 1 deletions

View file

@ -21,6 +21,11 @@ class WebGLRenderingContextBase
public:
virtual ~WebGLRenderingContextBase();
void present();
void clear(GLbitfield mask);
void clear_color(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
protected:
WebGLRenderingContextBase(HTML::HTMLCanvasElement& canvas_element, NonnullOwnPtr<GL::GLContext> context, WebGLContextAttributes context_creation_parameters, WebGLContextAttributes actual_context_parameters);
@ -46,6 +51,8 @@ private:
// - Canvas resize
// - clear, drawArrays, or drawElements has been called while the drawing buffer is the currently bound framebuffer
bool m_should_present { true };
void needs_to_present();
};
}