X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fresource.h;h=571d1ea56c54e61ab10c43ef0f10cce766f19bb3;hp=c41b88498dae84c5a0774398d410259b71055b5d;hb=4cb33c263a00787a57531dfc41a4128bf34d7bee;hpb=7db48f2836ec42c6e2dbeff336634a03bc6d7a62 diff --git a/source/resource.h b/source/resource.h index c41b8849..571d1ea5 100644 --- a/source/resource.h +++ b/source/resource.h @@ -1,12 +1,14 @@ #ifndef MSP_GL_RESOURCE_H_ #define MSP_GL_RESOURCE_H_ +#include #include namespace Msp { namespace GL { class ResourceManager; +class Resources; class Resource { @@ -24,13 +26,23 @@ public: protected: ResourceManager *manager; + void *manager_data; Resource(); public: virtual ~Resource(); void set_manager(ResourceManager *); - virtual AsyncLoader *load(IO::Seekable &) = 0; + ResourceManager *get_manager() const { return manager; } + void *get_manager_data() const { return manager_data; } + virtual int get_load_priority() const { return 0; } + virtual AsyncLoader *load(IO::Seekable &, const Resources * = 0) = 0; + virtual bool is_loaded() const; + + /** Returns the amount of graphics memory used by this resource. The + returned value must not change while the resource is loaded. */ + virtual UInt64 get_data_size() const = 0; + virtual void unload() = 0; };