work on moving shader loading/compilation to a separate file

This commit is contained in:
2025-08-17 00:32:43 -05:00
parent 06d99cf87e
commit 47564bb3cf
12 changed files with 199 additions and 72 deletions

19
inc/shaders.hpp Normal file
View File

@@ -0,0 +1,19 @@
#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