2023-11-02 00:48:32 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Noncopyable.h>
|
2023-11-10 18:00:18 +01:00
|
|
|
#include <LibAccelGfx/GL.h>
|
2023-11-02 00:48:32 +01:00
|
|
|
|
|
|
|
|
namespace AccelGfx {
|
|
|
|
|
|
|
|
|
|
class Program {
|
|
|
|
|
AK_MAKE_NONCOPYABLE(Program);
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static Program create(char const* vertex_shader_source, char const* fragment_shader_source);
|
|
|
|
|
|
|
|
|
|
void use();
|
2023-11-10 18:00:18 +01:00
|
|
|
GL::VertexAttribute get_attribute_location(char const* name);
|
|
|
|
|
GL::Uniform get_uniform_location(char const* name);
|
2023-11-02 00:48:32 +01:00
|
|
|
|
|
|
|
|
~Program();
|
|
|
|
|
|
|
|
|
|
private:
|
2023-11-10 18:00:18 +01:00
|
|
|
Program(GL::Program program)
|
|
|
|
|
: m_program(program)
|
2023-11-02 00:48:32 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-11-10 18:00:18 +01:00
|
|
|
GL::Program m_program;
|
2023-11-02 00:48:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|