allow external update request

This commit is contained in:
jrkb 2023-04-13 12:42:32 +02:00
parent b49d3cf459
commit 8b7cb20503
2 changed files with 8 additions and 0 deletions

View file

@ -52,6 +52,9 @@ class ShaderCatalog::Impl {
public: public:
Impl(const std::string & dir) : dir(dir){ Impl(const std::string & dir) : dir(dir){
} }
void requestUpdate(const std::string & name){
list.requestUpdate(name);
}
private: private:
std::string readFile(const std::string & filename, std::string & error){ std::string readFile(const std::string & filename, std::string & error){
@ -190,4 +193,8 @@ std::shared_ptr <ShaderCatalog::Entry> ShaderCatalog::get(const std::string & na
void ShaderCatalog::update(){ void ShaderCatalog::update(){
impl->update(); impl->update();
} }
void ShaderCatalog::requestUpdate(const std::string & name){
impl->requestUpdate(name);
}
} }

View file

@ -26,6 +26,7 @@ class ShaderCatalog {
std::shared_ptr <Entry> get(const std::string & name); std::shared_ptr <Entry> get(const std::string & name);
void update(); void update();
void requestUpdate(const std::string & name);
private: private:
class Impl; class Impl;