BsResource.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsCorePrerequisites.h"
  6. #include "BsIReflectable.h"
  7. #include "BsCoreObject.h"
  8. namespace BansheeEngine
  9. {
  10. /**
  11. * @brief Base class for all resources.
  12. */
  13. class BS_CORE_EXPORT Resource : public IReflectable, public CoreObject
  14. {
  15. public:
  16. Resource(bool requiresGpuInitialization = true);
  17. virtual ~Resource() {};
  18. /**
  19. * @brief Returns the name of the resource.
  20. */
  21. const String& getName() const { return mName; }
  22. /**
  23. * @brief Sets the name of the resource.
  24. */
  25. void setName(const String& name) { mName = name; }
  26. protected:
  27. friend class Resources;
  28. UINT32 mSize;
  29. String mName;
  30. /************************************************************************/
  31. /* SERIALIZATION */
  32. /************************************************************************/
  33. public:
  34. friend class ResourceRTTI;
  35. static RTTITypeBase* getRTTIStatic();
  36. virtual RTTITypeBase* getRTTI() const;
  37. };
  38. }