refactor GLSLExtension.cpp & add 'param' shader preprocessor directive & add PostEffect class (WIP)

This commit is contained in:
MihailRis
2025-04-03 21:46:12 +03:00
parent 531334f059
commit 1feee3a809
8 changed files with 263 additions and 97 deletions
+10 -7
View File
@@ -9,15 +9,8 @@
class ResPaths;
class GLSLExtension {
std::unordered_map<std::string, std::string> headers;
std::unordered_map<std::string, std::string> defines;
std::string version = "330 core";
const ResPaths* paths = nullptr;
void loadHeader(const std::string& name);
public:
void setPaths(const ResPaths* paths);
void setVersion(std::string version);
void define(const std::string& name, std::string value);
void undefine(const std::string& name);
@@ -26,12 +19,22 @@ public:
const std::string& getHeader(const std::string& name) const;
const std::string& getDefine(const std::string& name) const;
const std::unordered_map<std::string, std::string>& getDefines() const;
bool hasHeader(const std::string& name) const;
bool hasDefine(const std::string& name) const;
void loadHeader(const std::string& name);
std::string process(
const io::path& file,
const std::string& source,
bool header = false
);
static inline std::string VERSION = "330 core";
private:
std::unordered_map<std::string, std::string> headers;
std::unordered_map<std::string, std::string> defines;
const ResPaths* paths = nullptr;
};