1 #ifndef MSP_GL_RESOURCE_H_
2 #define MSP_GL_RESOURCE_H_
5 #include <msp/io/seekable.h>
10 class ResourceManager;
21 virtual ~AsyncLoader() { }
23 virtual bool needs_sync() const = 0;
24 virtual bool process() = 0;
28 ResourceManager *manager;
35 void set_manager(ResourceManager *);
36 ResourceManager *get_manager() const { return manager; }
37 void *get_manager_data() const { return manager_data; }
38 virtual int get_load_priority() const { return 0; }
39 virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) = 0;
40 virtual bool is_loaded() const;
42 /** Returns the amount of graphics memory used by this resource. The
43 returned value must not change while the resource is loaded. */
44 virtual std::uint64_t get_data_size() const = 0;
46 virtual void unload() = 0;