2024-12-05 19:18:40 -07:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibWeb/WebGL/Types.h>
|
|
|
|
|
#include <LibWeb/WebGL/WebGLObject.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::WebGL {
|
|
|
|
|
|
|
|
|
|
class WebGLSync : public WebGLObject {
|
|
|
|
|
WEB_PLATFORM_OBJECT(WebGLSync, WebGLObject);
|
|
|
|
|
GC_DECLARE_ALLOCATOR(WebGLSync);
|
|
|
|
|
|
|
|
|
|
public:
|
2024-12-17 06:15:53 +01:00
|
|
|
static GC::Ref<WebGLSync> create(JS::Realm& realm, WebGLRenderingContextBase&, GLsyncInternal handle);
|
2024-12-05 19:18:40 -07:00
|
|
|
|
|
|
|
|
virtual ~WebGLSync() override;
|
|
|
|
|
|
2025-10-20 20:57:06 +01:00
|
|
|
ErrorOr<GLsyncInternal> sync_handle(WebGLRenderingContextBase const* context) const;
|
2024-12-13 14:42:03 +00:00
|
|
|
|
2024-12-05 19:18:40 -07:00
|
|
|
protected:
|
2024-12-17 06:15:53 +01:00
|
|
|
explicit WebGLSync(JS::Realm&, WebGLRenderingContextBase&, GLsyncInternal handle);
|
2024-12-05 19:18:40 -07:00
|
|
|
|
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
2024-12-13 14:42:03 +00:00
|
|
|
|
|
|
|
|
GLsyncInternal m_sync_handle { nullptr };
|
2024-12-05 19:18:40 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|