| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsIReflectable.h"
- #include "BsCoreObject.h"
- namespace BansheeEngine
- {
- /** @addtogroup Resources
- * @{
- */
- /** Base class for all resources. */
- class BS_CORE_EXPORT Resource : public IReflectable, public CoreObject
- {
- public:
- Resource(bool requiresGpuInitialization = true);
- virtual ~Resource() {};
- /** Returns the name of the resource. */
- const WString& getName() const;
- /** Sets the name of the resource. */
- void setName(const WString& name);
- /** Retrieves meta-data containing various information describing a resource. */
- ResourceMetaDataPtr getMetaData() const { return mMetaData; }
- /** Returns whether or not this resource is allowed to be asynchronously loaded. */
- virtual bool allowAsyncLoading() const { return true; }
- protected:
- friend class Resources;
- friend class ResourceHandleBase;
- /** Retrieves a list of all resources that this resource depends on. */
- virtual void getResourceDependencies(FrameVector<HResource>& dependencies) const { }
- /** Checks if all the resources this object is dependent on are fully loaded. */
- bool areDependenciesLoaded() const;
- UINT32 mSize;
- ResourceMetaDataPtr mMetaData;
- /************************************************************************/
- /* SERIALIZATION */
- /************************************************************************/
- public:
- friend class ResourceRTTI;
- static RTTITypeBase* getRTTIStatic();
- virtual RTTITypeBase* getRTTI() const override;
- };
- /** @} */
- }
|