// Copyright (C) 2009-2022, Panagiotis Christopoulos Charitos and contributors. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #pragma once #include #include #include #include #include #include namespace anki { // Forward class GrManager; class ResourceManager; class ResourceFilesystem; template class ResourcePointer; class TransferGpuAllocatorHandle; /// @addtogroup resource /// @{ #define ANKI_RESOURCE_LOGI(...) ANKI_LOG("RSRC", NORMAL, __VA_ARGS__) #define ANKI_RESOURCE_LOGE(...) ANKI_LOG("RSRC", ERROR, __VA_ARGS__) #define ANKI_RESOURCE_LOGW(...) ANKI_LOG("RSRC", WARNING, __VA_ARGS__) #define ANKI_RESOURCE_LOGF(...) ANKI_LOG("RSRC", FATAL, __VA_ARGS__) /// Deleter for ResourcePtr. template class ResourcePtrDeleter { public: void operator()(T* ptr); }; /// Smart pointer for resources. template using ResourcePtr = IntrusivePtr>; // NOTE: Add resources in 3 places #define ANKI_INSTANTIATE_RESOURCE(rsrc_, name_) \ class rsrc_; \ using name_ = ResourcePtr; #define ANKI_INSTANSIATE_RESOURCE_DELIMITER() #include #undef ANKI_INSTANTIATE_RESOURCE #undef ANKI_INSTANSIATE_RESOURCE_DELIMITER template using ResourceAllocator = HeapAllocator; template using TempResourceAllocator = StackAllocator; /// An alias that denotes a ResourceFilesystem path. using ResourceFilename = CString; /// @} } // end namespace anki