1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:37:45 +00:00

LibWeb: Add the ability to retrieve a WebGL context from getContext

This commit is contained in:
Luke Wilde 2022-06-04 04:22:42 +01:00 committed by Linus Groh
parent b0c2aee2e4
commit 58f882200c
19 changed files with 903 additions and 21 deletions

View file

@ -0,0 +1,31 @@
/*
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/WebGL/WebGLRenderingContextBase.h>
namespace Web::WebGL {
class WebGLRenderingContext
: public WebGLRenderingContextBase
, public Bindings::Wrappable {
public:
using WrapperType = Bindings::WebGLRenderingContextWrapper;
static JS::ThrowCompletionOr<RefPtr<WebGLRenderingContext>> create(HTML::HTMLCanvasElement& canvas_element, JS::Value options);
virtual ~WebGLRenderingContext() override = default;
private:
WebGLRenderingContext(HTML::HTMLCanvasElement& canvas_element, NonnullOwnPtr<GL::GLContext> context, WebGLContextAttributes context_creation_parameters, WebGLContextAttributes actual_context_parameters)
: WebGLRenderingContextBase(canvas_element, move(context), move(context_creation_parameters), move(actual_context_parameters))
{
}
};
}