WebGLSync.h 766 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2024, Andrew Kaster <andrew@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/WebGL/Types.h>
  8. #include <LibWeb/WebGL/WebGLObject.h>
  9. namespace Web::WebGL {
  10. class WebGLSync : public WebGLObject {
  11. WEB_PLATFORM_OBJECT(WebGLSync, WebGLObject);
  12. GC_DECLARE_ALLOCATOR(WebGLSync);
  13. public:
  14. static GC::Ref<WebGLSync> create(JS::Realm& realm, WebGLRenderingContextBase&, GLsyncInternal handle);
  15. virtual ~WebGLSync() override;
  16. GLsyncInternal sync_handle() const { return m_sync_handle; }
  17. protected:
  18. explicit WebGLSync(JS::Realm&, WebGLRenderingContextBase&, GLsyncInternal handle);
  19. virtual void initialize(JS::Realm&) override;
  20. GLsyncInternal m_sync_handle { nullptr };
  21. };
  22. }