diff --git a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni index 957baae438b..516f783f761 100644 --- a/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni +++ b/Meta/gn/secondary/Userland/Libraries/LibWeb/idl_files.gni @@ -368,6 +368,7 @@ standard_idl_files = [ "//Userland/Libraries/LibWeb/WebAudio/PeriodicWave.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLBuffer.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLContextEvent.idl", + "//Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLObject.idl", "//Userland/Libraries/LibWeb/WebGL/WebGLRenderingContext.idl", "//Userland/Libraries/LibWeb/WebIDL/DOMException.idl", diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index 86e55670d8f..fef93f5ddfc 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -384,6 +384,7 @@ WeakRef WeakSet WebGLBuffer WebGLContextEvent +WebGLFramebuffer WebGLObject WebGLRenderingContext WebKitCSSMatrix diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index fa166ae8e6a..d394161418f 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -753,6 +753,7 @@ set(SOURCES WebGL/WebGLBuffer.cpp WebGL/WebGLContextAttributes.cpp WebGL/WebGLContextEvent.cpp + WebGL/WebGLFramebuffer.cpp WebGL/WebGLObject.cpp WebGL/WebGLRenderingContext.cpp WebGL/WebGLRenderingContextBase.cpp diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.cpp b/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.cpp new file mode 100644 index 00000000000..735e608e4d1 --- /dev/null +++ b/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.cpp @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#include +#include + +namespace Web::WebGL { + +JS_DEFINE_ALLOCATOR(WebGLFramebuffer); + +WebGLFramebuffer::WebGLFramebuffer(JS::Realm& realm) + : WebGLObject(realm) +{ +} + +WebGLFramebuffer::~WebGLFramebuffer() = default; + +} diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.h b/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.h new file mode 100644 index 00000000000..725edd2af9e --- /dev/null +++ b/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +namespace Web::WebGL { + +class WebGLFramebuffer final : public WebGLObject { + WEB_PLATFORM_OBJECT(WebGLFramebuffer, WebGLObject); + JS_DECLARE_ALLOCATOR(WebGLFramebuffer); + +public: + virtual ~WebGLFramebuffer(); + +protected: + explicit WebGLFramebuffer(JS::Realm&); +}; + +} diff --git a/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl b/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl new file mode 100644 index 00000000000..f00f1bac63d --- /dev/null +++ b/Userland/Libraries/LibWeb/WebGL/WebGLFramebuffer.idl @@ -0,0 +1,6 @@ +#import + +// https://registry.khronos.org/webgl/specs/latest/1.0/#5.5 +[Exposed=(Window,Worker)] +interface WebGLFramebuffer : WebGLObject { +}; diff --git a/Userland/Libraries/LibWeb/idl_files.cmake b/Userland/Libraries/LibWeb/idl_files.cmake index 90f06bbebea..e6f27cb7314 100644 --- a/Userland/Libraries/LibWeb/idl_files.cmake +++ b/Userland/Libraries/LibWeb/idl_files.cmake @@ -353,6 +353,7 @@ libweb_js_bindings(WebAudio/OscillatorNode) libweb_js_bindings(WebAudio/PeriodicWave) libweb_js_bindings(WebGL/WebGLBuffer) libweb_js_bindings(WebGL/WebGLContextEvent) +libweb_js_bindings(WebGL/WebGLFramebuffer) libweb_js_bindings(WebGL/WebGLObject) libweb_js_bindings(WebGL/WebGLRenderingContext) libweb_js_bindings(WebIDL/DOMException)