20 lines
458 B
C++
20 lines
458 B
C++
#pragma once
|
|
|
|
#include <glad/glad.h>
|
|
#include <variant>
|
|
#include "util.hpp"
|
|
|
|
namespace shader {
|
|
|
|
// Reads shader source files, compiles, and links
|
|
bool load(uint* out_id, const char *vertex_filepath, const char *fragment_filepath);
|
|
|
|
// Sets shader as active on the gpu
|
|
void use(uint id);
|
|
|
|
// Set uniform value
|
|
typedef std::variant<int, float, bool> uniform_variant;
|
|
void set_uniform(uint id, const char *name, uniform_variant value);
|
|
|
|
} // namespace shaders
|