Files
simian/include/ShaderManager.h
nick 28328cbc0d
CI / build-and-test (push) Successful in 2m5s
Sync Docs to Gitea Wiki / Sync docs to Gitea wiki (push) Failing after 23s
feat: editor improvements
2026-03-08 20:25:11 +13:00

40 lines
915 B
C++

#pragma once
#include "raylib.h"
#include <unordered_map>
#include <string>
struct ShaderSource {
std::string vsPath;
std::string fsPath;
};
class ShaderManager
{
public:
ShaderManager();
~ShaderManager();
// Load a shader from vertex and fragment shader files
// Returns a unique ID for the shader, or 0 on failure
unsigned int Load(const std::string& vsPath, const std::string& fsPath);
// Unload a shader by ID
void Unload(unsigned int id);
// Get a shader by ID (returns nullptr if not found)
Shader* Get(unsigned int id);
// Get source metadata for a shader if available
const ShaderSource* GetSource(unsigned int id) const;
// Unload all shaders
void UnloadAll();
private:
std::unordered_map<unsigned int, Shader> shaders;
std::unordered_map<unsigned int, ShaderSource> shaderSources;
unsigned int nextId;
bool unloaded;
};