14 #include <unordered_map> 16 #include <emilib/gl_lib_fwd.hpp> 20 class DelayedDirWatcher;
21 using DelayedDirWatcher_UP = std::unique_ptr<DelayedDirWatcher>;
24 gl::ProgramSource load_shader_file(
const std::string& shader_dir,
const std::string& name);
78 explicit ShaderMngr(
const std::string& shader_dir);
102 using FFMap = std::unordered_map<int, gl::Program_UP>;
103 using FileMap = std::unordered_map<std::string, gl::Program_UP>;
105 std::string _shader_dir;
106 DelayedDirWatcher_UP _dir_watcher;
void update()
call this periodically (e.g. every frame) to detect and reload modified shader files.
gl::Program * get_ff(int flags)
Construct shader from source.
ShaderMngr(const std::string &shader_dir)
Look for .shader files in shader_dir.
Definition: gl_lib.hpp:137
Definition: shader_mngr.hpp:74
gl::Program * get_file(const std::string &name)
Construct shader from shader_dir/name.shader. Memoizes.
Definition: gl_lib_fwd.hpp:48
Definition: coroutine.hpp:18