]> git.tdb.fi Git - libs/gl.git/blobdiff - source/resourcemanager.h
Support more ttf2png options in makefont.py
[libs/gl.git] / source / resourcemanager.h
index a1ff7aee2fc32adda60d12b0a63166c635e81822..e83a61328e590c528d1c05f7157dea0d523e995d 100644 (file)
@@ -13,6 +13,14 @@ namespace GL {
 
 class ResourceWatcher;
 
+class resource_load_error: public std::runtime_error
+{
+public:
+       resource_load_error(const std::string &, const std::exception &);
+       virtual ~resource_load_error() throw() { }
+};
+
+
 class ResourceManager
 {
 public:
@@ -32,7 +40,8 @@ private:
                        LOAD_QUEUED,
                        LOADING,
                        LOAD_FINISHED,
-                       LOADED
+                       LOADED,
+                       LOAD_ERROR
                };
 
                Resource *resource;
@@ -68,6 +77,7 @@ private:
                LoadQueue sync_queue;
                unsigned capacity;
                unsigned size;
+               std::list<resource_load_error> error_queue;
                volatile bool done;
 
        public:
@@ -117,6 +127,7 @@ public:
        void *get_data_for_resource(const Resource &);
        void set_resource_location(Resource &, DataFile::Collection &, const std::string &);
        void load_resource(Resource &);
+       bool is_resource_loaded(const Resource &);
        void resource_used(const Resource &);
        void remove_resource(Resource &);