C4 Engine
C4 Engine API Documentation


Defined in:  C4Resources.h
Reads some or all of the resource data.

ResourceResult Read(void *buffer, uint32 start, uint32 size);

buffer A pointer to the memory location where the resource data is loaded.
start The byte offset within the resource data at which the read operation starts.
size The number of bytes that are read into memory.
The Read function reads a portion of the resource data into memory. This function reads size bytes of data from the resource, beginning at the offset specified by the start parameter, and stores them in memory beginning at the location specified by the buffer parameter. The sum start + size should not exceed the size of the resource data returned by the ResourceLoader::GetDataSize function.

If the resource data is successfully loaded, then the return value is kResourceOkay. Otherwise, the return value is kResourceLoadFailed.
See Also