BsResource.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsIReflectable.h"
  4. #include "BsCoreObject.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Base class for all resources.
  9. */
  10. class BS_CORE_EXPORT Resource : public IReflectable, public CoreObject
  11. {
  12. public:
  13. Resource(bool requiresGpuInitialization = true);
  14. virtual ~Resource() {};
  15. /**
  16. * @brief Returns the name of the resource.
  17. */
  18. const WString& getName() const;
  19. /**
  20. * @brief Sets the name of the resource.
  21. */
  22. void setName(const WString& name);
  23. /**
  24. * @brief Retrieves meta-data containing various information describing a resource.
  25. */
  26. ResourceMetaDataPtr getMetaData() const { return mMetaData; }
  27. protected:
  28. friend class Resources;
  29. UINT32 mSize;
  30. ResourceMetaDataPtr mMetaData;
  31. /************************************************************************/
  32. /* SERIALIZATION */
  33. /************************************************************************/
  34. public:
  35. friend class ResourceRTTI;
  36. static RTTITypeBase* getRTTIStatic();
  37. virtual RTTITypeBase* getRTTI() const;
  38. };
  39. }