Plasma Engine  2.0
Loading...
Searching...
No Matches
plTextureResourceLoader Class Reference
Inheritance diagram for plTextureResourceLoader:

Classes

struct  LoadedData
 

Public Member Functions

virtual plResourceLoadData OpenDataStream (const plResource *pResource) override
 Override this function to implement the resource loading.
 
virtual void CloseDataStream (const plResource *pResource, const plResourceLoadData &loaderData) override
 This function is called when the resource has been updated with the data from the resource loader and the loader can deallocate any temporary memory.
 
virtual bool IsResourceOutdated (const plResource *pResource) const override
 If this function returns true, a resource is unloaded and loaded again to update its content.
 

Static Public Member Functions

static plResult LoadTexFile (plStreamReader &inout_stream, LoadedData &ref_data)
 
static void WriteTextureLoadStream (plStreamWriter &inout_stream, const LoadedData &data)
 

Member Function Documentation

◆ CloseDataStream()

void plTextureResourceLoader::CloseDataStream ( const plResource * pResource,
const plResourceLoadData & loaderData )
overridevirtual

This function is called when the resource has been updated with the data from the resource loader and the loader can deallocate any temporary memory.

Implements plResourceTypeLoader.

◆ IsResourceOutdated()

bool plTextureResourceLoader::IsResourceOutdated ( const plResource * pResource) const
overridevirtual

If this function returns true, a resource is unloaded and loaded again to update its content.

Call plResource::GetLoadedFileModificationTime() to query the file modification time that was returned through plResourceLoadData::m_LoadedFileModificationDate.

Reimplemented from plResourceTypeLoader.

◆ OpenDataStream()

plResourceLoadData plTextureResourceLoader::OpenDataStream ( const plResource * pResource)
overridevirtual

Override this function to implement the resource loading.

This function should take the information from pResource, e.g. which file to load, and do the loading work. It should allocate temporary storage for the loaded data and encode it in a memory stream, such that the resource can read all necessary information from the stream.

See also
plResourceLoadData

In case this is not a proper asset (plTextureXX format), this is a hack to get the SRGB information for the texture

Todo
A conversion to B8G8R8X8_UNORM currently fails

Implements plResourceTypeLoader.


The documentation for this class was generated from the following files: