mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
GLSL 'include' support
This commit is contained in:
parent
e6ecd558a9
commit
a60cc70246
20 changed files with 238 additions and 35 deletions
33
src/coders/GLSLExtension.h
Normal file
33
src/coders/GLSLExtension.h
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
#ifndef CODERS_GLSL_EXTESION_H_
|
||||
#define CODERS_GLSL_EXTESION_H_
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <filesystem>
|
||||
|
||||
class GLSLExtension {
|
||||
std::unordered_map<std::string, std::string> headers;
|
||||
std::unordered_map<std::string, std::string> defines;
|
||||
std::filesystem::path libFolder;
|
||||
std::string version = "330 core";
|
||||
|
||||
void loadHeader(std::string name);
|
||||
std::filesystem::path getHeaderPath(std::string name);
|
||||
public:
|
||||
void setLibFolder(std::filesystem::path folder);
|
||||
void setVersion(std::string version);
|
||||
|
||||
void define(std::string name, std::string value);
|
||||
void undefine(std::string name);
|
||||
void addHeader(std::string name, std::string source);
|
||||
|
||||
const std::string& getHeader(const std::string name) const;
|
||||
const std::string getDefine(const std::string name) const;
|
||||
|
||||
bool hasHeader(const std::string name) const;
|
||||
bool hasDefine(const std::string name) const;
|
||||
|
||||
const std::string process(const std::filesystem::path file, const std::string& source);
|
||||
};
|
||||
|
||||
#endif // CODERS_GLSL_EXTESION_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue