LibWeb: Add WebGLBuffer

This commit is contained in:
Jelle Raaijmakers 2024-11-13 09:35:57 +01:00 committed by Andreas Kling
commit b21857b265
Notes: github-actions[bot] 2024-11-13 10:43:35 +00:00
8 changed files with 56 additions and 1 deletions

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/WebGLBufferPrototype.h>
#include <LibWeb/WebGL/WebGLBuffer.h>
namespace Web::WebGL {
JS_DEFINE_ALLOCATOR(WebGLBuffer);
WebGLBuffer::WebGLBuffer(JS::Realm& realm)
: WebGLObject(realm)
{
}
WebGLBuffer::~WebGLBuffer() = default;
}

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/WebGL/WebGLObject.h>
namespace Web::WebGL {
class WebGLBuffer final : public WebGLObject {
WEB_PLATFORM_OBJECT(WebGLBuffer, WebGLObject);
JS_DECLARE_ALLOCATOR(WebGLBuffer);
public:
virtual ~WebGLBuffer();
protected:
explicit WebGLBuffer(JS::Realm&);
};
}

View file

@ -0,0 +1,6 @@
#import <WebGL/WebGLObject.idl>
// https://registry.khronos.org/webgl/specs/latest/1.0/#5.4
[Exposed=(Window,Worker)]
interface WebGLBuffer : WebGLObject {
};

View file

@ -11,7 +11,7 @@
namespace Web::WebGL {
class WebGLObject : public Bindings::PlatformObject {
WEB_PLATFORM_OBJECT(WebGLRenderingContextBase, Bindings::PlatformObject);
WEB_PLATFORM_OBJECT(WebGLObject, Bindings::PlatformObject);
public:
virtual ~WebGLObject();