]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resourcemanager.h
Add a ResourceWatcher interface
[libs/gl.git] / source / resourcemanager.h
index 60f61a421fe4b2b54685a2366cd339e9bfa9be2d..f5ccac3bbf9a212eefe8611a865bb25a059737b2 100644 (file)
@@ -11,6 +11,8 @@
 namespace Msp {
 namespace GL {
 
+class ResourceWatcher;
+
 class ResourceManager
 {
 public:
@@ -32,12 +34,16 @@ private:
                bool loaded;
                unsigned last_used;
                UInt64 data_size;
+               std::vector<ResourceWatcher *> watchers;
 
                ManagedResource(Resource &);
 
                void start_loading();
                void finish_loading();
                void unload();
+
+               void add_watcher(ResourceWatcher &);
+               void remove_watcher(ResourceWatcher &);
        };
 
        class LoadingThread: public Thread
@@ -104,6 +110,9 @@ public:
        void resource_used(const Resource &);
        void remove_resource(Resource &);
 
+       void watch_resource(const Resource &, ResourceWatcher &);
+       void unwatch_resource(const Resource &, ResourceWatcher &);
+
        void tick();
        UInt64 get_total_data_size() const;
 };