CmResource.h 889 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmIReflectable.h"
  4. #include "CmCoreObject.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Base class for all resources used in the engine.
  9. */
  10. class CM_EXPORT Resource : public IReflectable, public CoreObject
  11. {
  12. public:
  13. Resource(bool requiresGpuInitialization = true);
  14. virtual ~Resource() {};
  15. const String& getName() const { return mName; }
  16. void setName(const String& name) { mName = name; }
  17. protected:
  18. friend class Resources;
  19. UINT32 mSize;
  20. String mName;
  21. /************************************************************************/
  22. /* SERIALIZATION */
  23. /************************************************************************/
  24. public:
  25. friend class ResourceRTTI;
  26. static RTTITypeBase* getRTTIStatic();
  27. virtual RTTITypeBase* getRTTI() const;
  28. };
  29. }