LibWeb: Save OpenGL handle in WebGLObject

This commit is contained in:
Aliaksandr Kalenik 2024-11-30 16:53:52 +01:00 committed by Alexander Kalenik
parent 46cbbda944
commit cfb394cad3
Notes: github-actions[bot] 2024-12-03 22:37:03 +00:00
15 changed files with 83 additions and 20 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -7,6 +8,9 @@
#pragma once
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/WebGL/Types.h>
typedef unsigned int GLuint;
namespace Web::WebGL {
@ -19,14 +23,17 @@ public:
String label() const { return m_label; }
void set_label(String const& label) { m_label = label; }
GLuint handle() const { return m_handle; }
protected:
explicit WebGLObject(JS::Realm&);
explicit WebGLObject(JS::Realm&, GLuint handle);
bool invalidated() const { return m_invalidated; }
private:
bool m_invalidated { false };
String m_label;
GLuint m_handle { 0 };
};
}