Defined in:Returns a reference to a texture object.
static Texture *GetTexture(const char *name);
static Texture *GetTexture(const TextureHeader *header, const void *image = nullptr);
||The name of the texture resource.|
||A pointer to a |
||A pointer to the pixel image for the texture. If this is |
GetTexturefunction returns a reference to a texture map object. A texture map may be stored in a resource or created in memory, and the location determines which version of the
GetTexturefunction should be called. If the texture is stored in a resource, then the version of the
GetTexturefunction taking the name of the resource in the
nameparameter should be called. If the texture image exists in memory, then the version of the
GetTexturefunction taking a
TextureHeaderstructure should be called.
If a texture object already exists for the parameters passed to the
GetTexturefunction, then its reference count is incremented, and a pointer to the existing object is returned. Otherwise, a new texture object is created with a reference count of 1, and a pointer to the new object is returned. If an attempt is made to create a texture object for a resource that does not exist, then the return value is a pointer to a special "missing" texture map.
imageparameters are used to create a texture map from data stored in memory, the header and image data must continue to exist in memory for the lifetime of the texture object returned by the
For each successful call to the
GetTexturefunction, there should be a balancing call to the
Shared::Releasefunction that releases the texture object.