df08210f77
- Add shader class for vertex/fragment program compilation - Add vao class for vertex array object management - Render RGB gradient triangle with interpolated vertex colors
32 lines
591 B
C++
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;
|
|
};
|
|
|
|
}
|