Scaleform::Render::HALNotify Scaleform::Render::ImageUpdateSync Scaleform::Render::TextureManager
class TextureManager : public RefCountBase<TextureManager, StatRender_TextureManager_Mem>, public ImageUpdateSync, public HALNotify;
TextureManager is a Texture resource creation class that allows images to be loaded directly from video memory. The texture creation needs to be either thread-safe or serviced by a render thread.
When loading image data, if a texture manager is specified and cannot lose data, the image content will be loaded directly into the texture memory. The rendering thread needs to be initialized before the image data is loaded directly into textures. If no texture manager is specified, image data will be loaded into system memory first and thus can take place before renderer initialization.
Unlike the rendering methods of Render::HAL, TextureManager methods such as CreateTexture must be thread-safe since they may be called from different loading threads. This thread safety is achieved in one of two ways:
• By implementing texture memory allocation in a thread-safe manner, such as on consoles or with D3D9 when the device is created with D3DCREATE_MULTITHREADED flag.
• By delegating texture creation to the render thread through the ThreadCommandQueue interface, specified in Render::HAL constructor.
The second approach means that if doing multi-threaded rendering with a non multi-threaded D3D device, you must implement ThreadCommandQueue and service it as necessary for texture creation. If this is not done, texture creation will block once called from a secondary thread.
Method |
Description |
Should be called before each frame on the RenderThread. | |
Begins scene rendering. | |
Reports whether textures can be created on the current thread | |
Creates a depth/stencil surface four use with a render target. | |
Creates a DepthStencil buffer. | |
Creates a texture object that can be initialized with an image later. | |
Should be called at end of each frame on RenderThread. | |
Completes scene rendering. | |
Returns the placeholder texture for a texture that has been disposed. | |
Reports the desired format for DrawableImages. | |
Returns the memory manager used for allocations. | |
Returns the RenderSync object. | |
Used to create an ImageSwizzler instance in order to transparently swizzle pixel get/set operations on an ImageData instance. | |
Returns the TextureCache for this texture manager (may be NULL). | |
Reports ImageUse flags supported by the renderer for this image format. | |
Returns which image format types a texture manager supports rendering natively. | |
Determines whether the input format is an acceptable DrawableImage format for this texture manager. | |
Determines whether non-power of two textures is supported. | |
Called when the video mode changes. | |
Processes work queued up on other threads, including texture creation and image updates. | |
Called to release all GPU texture resources. This must be called on the render thread. | |
Sets the RenderSync object. | |
TextureManager constructor. | |
Queues up a default full-image update implemented by mapping the texture. | |
Queues up a custom image update. |
Render_Image.h