mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor GLSLExtension.cpp & add 'param' shader preprocessor directive & add PostEffect class (WIP)
This commit is contained in:
parent
531334f059
commit
1feee3a809
8 changed files with 263 additions and 97 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue