Scaleform::GFx::State Scaleform::GFx::ImageCreator
class ImageCreator : public State;
ImageCreator is used to create Image objects in Scaleform player. By substituting this interface, texture loading behavior can be controlled. ImageCreator is a state object installed on GFx::Loader to customize image data loading, as follows:
GFx::Loader mloader; ... Ptr<GFx::ImageCreator> pimageCreator = *new GFx::ImageCreator(pRenderThread->GetTextureManager()); mloader.SetImageCreator(pimageCreator);
The default ImageCreator takes an optional TextureManager pointer in the constructor; if a texture manager is specified and can’t lose data, image content will be loaded directly into texture memory.
To load images asynchronously:
1. Overload LoadProtocolImage. Generally users return a Render::TextureImage from this function, although you can return any Render::Image class you'd like.
2. When your texture is finished loading, call Image::GetTexture on the returned Image object from step 1.
3. From the Texture object from step 2, call Texture::Initialize passing in your loaded texture.
4. If the textures are the different sizes, then you must also call SetMatrix on the Image from step 1. You can create an appropriate scaling matrix by calling Matrix2F::Scaling( old.Width / new.Width, old.Height / new.Height), where 'old' is the size of the Image object from step 1, and 'new' is the dimensions of the texture using Texture::Initialize.
Data Member |
Description |
TextureManager is passed if it is available at image creation time. This can be used to create textures directly out of image data; however, renderer must then be configured before file loading. |
Enumeration |
Description |
Identifies image creation loading stage. Load stage takes place before Bind stage. |
Method |
Description |
Creates and returns the image that matches the expected protocol. | |
GetBindKey can be returned if image creation depends | |
Obtains the TextureManager for creating textures directly out of the image data. | |
ImageCreator constructor. | |
Loads an exported image file. | |
Loads an image from a file. | |
Loads an image based on the url protocol string. |
GFx_ImageCreator.h