mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 19:57:44 +00:00
LibGL: Add Shader and Program class stubs
This commit is contained in:
parent
cd7d2c3446
commit
b975569a40
5 changed files with 126 additions and 0 deletions
38
Userland/Libraries/LibGL/Shaders/Shader.h
Normal file
38
Userland/Libraries/LibGL/Shaders/Shader.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Error.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGL/GL/glplatform.h>
|
||||
|
||||
namespace GL {
|
||||
|
||||
class Shader final : public RefCounted<Shader> {
|
||||
public:
|
||||
static NonnullRefPtr<Shader> create(GLenum shader_type);
|
||||
|
||||
void clear_sources() { m_sources.clear(); }
|
||||
ErrorOr<void> add_source(StringView source_code);
|
||||
ErrorOr<void> compile();
|
||||
GLenum type() const { return m_type; }
|
||||
|
||||
private:
|
||||
explicit Shader(GLenum shader_type)
|
||||
: m_type { shader_type }
|
||||
{
|
||||
}
|
||||
|
||||
Vector<String> m_sources;
|
||||
GLenum m_type;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue