GenericResource.h 745 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright (C) 2009-present, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Resource/ResourceObject.h>
  7. #include <AnKi/Util/WeakArray.h>
  8. namespace anki {
  9. /// @addtogroup resource
  10. /// @{
  11. /// A generic resource. It just loads a file to memory.
  12. class GenericResource : public ResourceObject
  13. {
  14. public:
  15. GenericResource(CString fname, U32 uuid)
  16. : ResourceObject(fname, uuid)
  17. {
  18. }
  19. ~GenericResource() = default;
  20. Error load(const ResourceFilename& filename, Bool async);
  21. ConstWeakArray<U8> getData() const
  22. {
  23. return m_data;
  24. }
  25. private:
  26. ResourceDynamicArray<U8> m_data;
  27. };
  28. /// @}
  29. } // end namespace anki