2024-11-13 10:06:07 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
|
2024-11-30 16:53:52 +01:00
|
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
2024-12-05 15:13:02 +00:00
|
|
|
* Copyright (c) 2024, Luke Wilde <luke@ladybird.org>
|
2024-11-13 10:06:07 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2024-11-30 16:53:52 +01:00
|
|
|
#include <LibWeb/WebGL/Types.h>
|
2024-11-13 10:06:07 +01:00
|
|
|
#include <LibWeb/WebGL/WebGLObject.h>
|
|
|
|
|
|
|
|
namespace Web::WebGL {
|
|
|
|
|
|
|
|
class WebGLShader final : public WebGLObject {
|
|
|
|
WEB_PLATFORM_OBJECT(WebGLShader, WebGLObject);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(WebGLShader);
|
2024-11-13 10:06:07 +01:00
|
|
|
|
|
|
|
public:
|
2025-01-09 17:20:59 +00:00
|
|
|
static GC::Ref<WebGLShader> create(JS::Realm& realm, WebGLRenderingContextBase&, GLuint handle, GLenum type);
|
2024-11-30 16:53:52 +01:00
|
|
|
|
2024-11-13 10:06:07 +01:00
|
|
|
virtual ~WebGLShader();
|
|
|
|
|
2025-01-09 17:20:59 +00:00
|
|
|
GLenum type() const { return m_type; }
|
|
|
|
|
2024-11-13 10:06:07 +01:00
|
|
|
protected:
|
2025-01-09 17:20:59 +00:00
|
|
|
explicit WebGLShader(JS::Realm&, WebGLRenderingContextBase&, GLuint handle, GLenum type);
|
2024-12-05 15:13:02 +00:00
|
|
|
|
|
|
|
virtual void initialize(JS::Realm&) override;
|
2025-01-09 17:20:59 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
GLenum m_type { 0 };
|
2024-11-13 10:06:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|