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>
|
2025-01-09 17:20:59 +00:00
|
|
|
* Copyright (c) 2024-2025, Luke Wilde <luke@ladybird.org>
|
2024-11-13 10:06:07 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
2024-11-30 16:53:52 +01:00
|
|
|
#include <LibJS/Runtime/Realm.h>
|
2024-12-05 15:13:02 +00:00
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
2024-11-13 10:06:07 +01:00
|
|
|
#include <LibWeb/Bindings/WebGLShaderPrototype.h>
|
|
|
|
#include <LibWeb/WebGL/WebGLShader.h>
|
|
|
|
|
|
|
|
namespace Web::WebGL {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(WebGLShader);
|
2024-11-13 10:06:07 +01:00
|
|
|
|
2025-01-09 17:20:59 +00:00
|
|
|
GC::Ref<WebGLShader> WebGLShader::create(JS::Realm& realm, WebGLRenderingContextBase& context, GLuint handle, GLenum type)
|
2024-11-30 16:53:52 +01:00
|
|
|
{
|
2025-01-09 17:20:59 +00:00
|
|
|
return realm.create<WebGLShader>(realm, context, handle, type);
|
2024-11-30 16:53:52 +01:00
|
|
|
}
|
|
|
|
|
2025-01-09 17:20:59 +00:00
|
|
|
WebGLShader::WebGLShader(JS::Realm& realm, WebGLRenderingContextBase& context, GLuint handle, GLenum type)
|
2024-12-17 06:15:53 +01:00
|
|
|
: WebGLObject(realm, context, handle)
|
2025-01-09 17:20:59 +00:00
|
|
|
, m_type(type)
|
2024-11-13 10:06:07 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
WebGLShader::~WebGLShader() = default;
|
|
|
|
|
2024-12-05 15:13:02 +00:00
|
|
|
void WebGLShader::initialize(JS::Realm& realm)
|
|
|
|
{
|
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLShader);
|
2025-04-20 16:22:57 +02:00
|
|
|
Base::initialize(realm);
|
2024-12-05 15:13:02 +00:00
|
|
|
}
|
|
|
|
|
2024-11-13 10:06:07 +01:00
|
|
|
}
|