WebGLObject.h 860 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
  3. * Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibWeb/Bindings/PlatformObject.h>
  9. #include <LibWeb/WebGL/Types.h>
  10. typedef unsigned int GLuint;
  11. namespace Web::WebGL {
  12. class WebGLObject : public Bindings::PlatformObject {
  13. WEB_PLATFORM_OBJECT(WebGLObject, Bindings::PlatformObject);
  14. public:
  15. virtual ~WebGLObject();
  16. String label() const { return m_label; }
  17. void set_label(String const& label) { m_label = label; }
  18. GLuint handle() const { return m_handle; }
  19. protected:
  20. explicit WebGLObject(JS::Realm&, GLuint handle);
  21. bool invalidated() const { return m_invalidated; }
  22. private:
  23. bool m_invalidated { false };
  24. String m_label;
  25. GLuint m_handle { 0 };
  26. };
  27. }