7#include "ResourceManager.h"
9#include "DataFetcherManager.h"
13#include "ITextureLoader.h"
36 void initialize()
override;
38 void clear()
override;
56 TextureHandle loadTexture(
const void * imageData, ResourceDimensions target,
int width,
int height,
int depth,
int layers, TextureFormat format,
int stride,
const ResourceId resourceId,
TextureLoadFlags flags);
77 TextureHandle loadTexture(
const void * imageData, ResourceDimensions target,
int width,
int height,
int depth,
int layers, TextureFormat format,
int stride,
const TextureHandle& resourceHandle,
TextureLoadFlags flags);
79 template<
typename RESOURCE>
80 TextureHandle loadTexture2D(
const void * imageData,
int width,
int height, TextureFormat format,
int stride, RESOURCE resource,
TextureLoadFlags flags) {
81 return loadTexture(imageData, ResourceDimensions::Texture2D, width, height, 1, 1, format, stride, resource, flags);
98 TextureHandle loadExternalTexture(intptr_t externalHandle, ResourceDimensions target,
int width,
int height,
int depth,
int layers, TextureFormat format,
const ResourceId resourceId, TextureLoadFlags flags);
110 TextureHandle loadTexture(
const StringView & resourceName,
const ResourceId resourceId, TextureLoadFlags flags);
124 TextureHandle loadTextureFromMemory(
const void* dataPtr,
const size_t dataSize,
const StringView& resourcePath,
const ResourceId resourceId, TextureLoadFlags flags);
142 void handleLoad(TextureLoadInfo * loadInfo)
override;
144 void handleReload(ResourceHandleBase handle)
override;
146 void loadFromData(TextureLoadInfo * loadInfo);
150 ActivationResult handleActivation(
TextureHandle handle, Texture * texture)
override;
153 void handleDeletion(Texture * texture)
override;
159 void postProcessLoading() override final;
162 std::thread::
id main;
164 bool invokeLoader(ITextureLoader* loader, TextureLoadInfo* loadInfo);
166 bool invokeLoader(ILoadedTextureLoader* loadedLoader, TextureLoadInfo* loadInfo);
169 bool processFetchedItem(ILoadedTextureLoader* loadedLoader, TextureLoadInfo* loadInfo,
std::unique_ptr<
FileContents> data);
172 std::unique_ptr<FileContents> data;
178 std::queue<FetchedItem> fetchedItems;
182 std::map<size_t, DataFetcherManager::FetchId> map;
A Context instance contains all the services, systems and runtime components needed to use Cogs.
The generic resource manager provides a base implementation for specialized resource managers to buil...
Texture manager responsible for loading, processing, activation and lifetime of Texture resources.
TextureManager(Context *context)
Constructs a TextureManager in the given context.
Provides a weakly referenced view over the contents of a string.
TextureLoadFlags
Texture loading flags. May be combined with resource load flags.
Contains all Cogs related functionality.
Abstract base class storing data read from a file.