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:
parent
b0c2aee2e4
commit
58f882200c
19 changed files with 903 additions and 21 deletions
31
Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.h
Normal file
31
Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.h
Normal 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))
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue