mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
~ | Shader hot reloading
This commit is contained in:
@ -24,19 +24,24 @@ class Shader
|
||||
|
||||
void compile(void);
|
||||
void reload();
|
||||
|
||||
bool hasChanged();
|
||||
|
||||
void setDefine(const std::string &name, const std::string &value);
|
||||
|
||||
GLuint getShader(void) const;
|
||||
GLuint getShader(void) const;
|
||||
const std::string &getFilePath(void) const;
|
||||
|
||||
private:
|
||||
void checkCompileErrors();
|
||||
|
||||
std::map<std::string, std::string> _defines;
|
||||
|
||||
GLenum _type;
|
||||
GLuint _shader_id;
|
||||
std::string _file_path;
|
||||
GLenum _type;
|
||||
GLuint _shader_id;
|
||||
std::string _file_path;
|
||||
|
||||
std::unordered_map<std::string, std::filesystem::file_time_type> _files_timestamps;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -26,11 +26,12 @@ class ShaderProgram
|
||||
|
||||
void link(void);
|
||||
|
||||
void use(void) const;
|
||||
void dispathCompute(GLuint x, GLuint y, GLuint z) const;
|
||||
void use(void);
|
||||
void dispathCompute(GLuint x, GLuint y, GLuint z);
|
||||
|
||||
void bindImageTexture(GLuint texture_id, GLuint unit, GLenum access, GLenum format) const;
|
||||
|
||||
void watchForChanges(void);
|
||||
void reloadShaders(void);
|
||||
|
||||
void set_int(const std::string &name, int value) const;
|
||||
|
Reference in New Issue
Block a user