class TextureManager

Defines interface for creation of textures.

Render systems provide their own implementations.

Public

Methods

~TextureManager

virtual ~TextureManager() noexcept = default

CreateRenderTexture

virtual SPtr<RenderTexture> CreateRenderTexture(const TextureCreateInformation &colorDesc, bool createDepth = true, PixelFormat depthStencilFormat = PF_D32)

Creates a new RenderTexture and automatically generates a single color surface and (optionally) a depth/stencil surface.

colorDesc
Description of the color surface to create.
createDepth
Determines will a depth/stencil buffer of the same size as the color buffer be created for the render texture.
depthStencilFormat
Format of the depth/stencil buffer if enabled.

CreateRenderTexture

virtual SPtr<RenderTexture> CreateRenderTexture(const RenderTextureCreateInformation &desc)

Creates a RenderTexture using the description struct.

desc
Description of the render texture to create.

GetNativeFormat

virtual PixelFormat GetNativeFormat(TextureType ttype, PixelFormat format, TextureUsageFlags usage, bool hwGamma) = 0

Gets the format which will be natively used for a requested format given the constraints of the current device.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

CreateRenderTextureImpl

virtual SPtr<RenderTexture> CreateRenderTextureImpl(const RenderTextureCreateInformation &desc) = 0

Creates an empty and uninitialized render texture of a specific type.

This is to be implemented by render systems with their own implementations.

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.