Files
cuber/cbt/opengl/shader.hpp
T
portersky df08210f77 feat: render per-vertex color triangle
- Add shader class for vertex/fragment program compilation
- Add vao class for vertex array object management
- Render RGB gradient triangle with interpolated vertex colors
2026-05-05 22:05:40 +02:00

32 lines
591 B
C++

#pragma once
#include <string>
#include "glad/glad.h"
namespace cbt::opengl {
class shader {
GLuint m_id = 0;
public:
shader();
~shader();
shader(const shader&) = delete;
shader& operator=(const shader&) = delete;
shader(shader&& other) noexcept;
shader& operator=(shader&& other) noexcept;
auto compile_vertex(const char* source) -> bool;
auto compile_fragment(const char* source) -> bool;
auto link() -> bool;
auto use() const -> void;
auto unuse() const -> void;
auto id() const -> GLuint;
auto valid() const -> bool;
};
}