ladybird/Libraries/LibWeb/WebGL/WebGLShader.cpp

38 lines
1,009 B
C++
Raw Normal View History

2024-11-13 10:06:07 +01:00
/*
* Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
* Copyright (c) 2024-2025, Luke Wilde <luke@ladybird.org>
2024-11-13 10:06:07 +01:00
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibJS/Runtime/Realm.h>
#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 {
GC_DEFINE_ALLOCATOR(WebGLShader);
2024-11-13 10:06:07 +01:00
GC::Ref<WebGLShader> WebGLShader::create(JS::Realm& realm, WebGLRenderingContextBase& context, GLuint handle, GLenum type)
{
return realm.create<WebGLShader>(realm, context, handle, type);
}
WebGLShader::WebGLShader(JS::Realm& realm, WebGLRenderingContextBase& context, GLuint handle, GLenum type)
: WebGLObject(realm, context, handle)
, m_type(type)
2024-11-13 10:06:07 +01:00
{
}
WebGLShader::~WebGLShader() = default;
void WebGLShader::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(WebGLShader);
Base::initialize(realm);
}
2024-11-13 10:06:07 +01:00
}