VAPOR3 3.9.4
ShaderManager.h
Go to the documentation of this file.
1#pragma once
2
5#include <string>
6#include <vector>
7
8namespace VAPoR {
9
17
18class RENDER_API ShaderManager : public IResourceManager<std::string, ShaderProgram> {
19 std::map<std::string, std::map<string, long>> _dependencyModifiedTimes;
20
21 std::vector<std::string> _getSourceFilePaths(const std::string &name) const;
22 bool _wasFileModified(const std::string &path) const;
23 static std::string _getNameFromKey(const std::string &key);
24 static std::vector<std::string> _getDefinesFromKey(const std::string &key);
25
26public:
27 ShaderProgram * GetShader(const std::string &name);
28 SmartShaderProgram GetSmartShader(const std::string &name);
29 int LoadResourceByKey(const std::string &key);
30
36 static Shader *CompileNewShaderFromFile(const std::string &path, const std::vector<std::string> &defines = {});
37
43 static unsigned int GetShaderTypeFromPath(const std::string &path);
44
59 static std::string PreProcessShader(const std::string &path, const std::vector<std::string> &defines = {});
60 static std::vector<std::string> GetShaderDependencies(const std::string &path);
61};
62
63} // namespace VAPoR
Resource management class for shaders.
Definition: ShaderManager.h:18
ShaderProgram * GetShader(const std::string &name)
static unsigned int GetShaderTypeFromPath(const std::string &path)
static Shader * CompileNewShaderFromFile(const std::string &path, const std::vector< std::string > &defines={})
int LoadResourceByKey(const std::string &key)
static std::string PreProcessShader(const std::string &path, const std::vector< std::string > &defines={})
SmartShaderProgram GetSmartShader(const std::string &name)
static std::vector< std::string > GetShaderDependencies(const std::string &path)
Provides a C++ interface to the OpenGL shader program construct.
Definition: ShaderProgram.h:25
Provides a C++ interface to the OpenGL shader construct.
Definition: Shader.h:16
Provides a C++ interface to the OpenGL shader program construct.
#define RENDER_API
Definition: common.h:78