TextureImageStore


Interface for a callback to allow the caller to provide a particular CGImageRef corresponding to a client-provided texture ID.

Summary

Public functions

operator CPointer<CGImage>?
get(clientTextureId: String)

Retrieve a CGImageRef for the given texture ID.

N

Public functions

get

operator fun get(clientTextureId: String): CPointer<CGImage>?

Retrieve a CGImageRef for the given texture ID. This may be called synchronously during drawing, so loading of texture files from disk and decoding them into CGImageRef objects should be done on initialization. The result may be cached by consumers, so this should return a deterministic result for a given input.

Textures can be disabled by having this function always return null. null should also be returned when a texture can not be loaded. If null is returned, the texture layer in question should be ignored, allowing for graceful fallback. It's recommended that implementations log when a texture can not be loaded.

Returns
CPointer<CGImage>?

The texture image, if any, associated with the given ID.