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
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#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;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user