TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class DirectX11TextureFactory in Tinman.AddOns.DirectX11

Implementation of the ITextureFactory interface that uses a Direct3D 11 ID3D11DeviceContext COM object.

sealed class DirectX11TextureFactory extends TextureFactory

Public / Attributes

AvailableVideoMemory

Returns the amount of available video memory.

public property AvailableVideoMemory { get }
type int64
value [>=0] The amount of available video memory, in bytes.
inherited TextureFactory.AvailableVideoMemory

Public / Constructors

DirectX11TextureFactory

Creates a new instance of DirectX11TextureFactory.

public constructor DirectX11TextureFactory (IntPtr context, int64 availableVideoMemory)
params context The ID3D11DeviceContext* COM pointer.
  availableVideoMemory [>0] See AvailableVideoMemory.

Public / Methods

CreateTexture2D

Creates a static ITexture2D object (i.e. CanSetTexels and CanCopyTexels return false).

[OwnerReturn]
public method CreateTexture2D (TexelBuffer buffer, bool warn = true)
type ITexture2D
params buffer [not-null] The buffer that holds the texture content. The Srgb flag of this buffer defines the sRGB behaviour of the created texture (see IsSrgb).
  warn Emit a warning log message if the TextureFormat of the given buffer needs to be converted to a supported format? Defaults to true.
returns [not-null] The ITexture2D object.
inherited TextureFactory.CreateTexture2D

Remarks:

The texel buffer size is validated (see ValidateTextureSize) before the texture is created, so the size of the returned ITexture2D object might be different to Width and/or Height.

The ValidateTextureFormat method will be called to find a supported texture format for the given texture contents (see Format), and the texture contents will be transcoded, if necessary.


Creates a dynamic ITexture2D object (i.e. CanSetTexels returns true).

[OwnerReturn]
public method CreateTexture2D (int32 width, int32 height, TextureFormat format, int32 mipmaps = 1, bool data = false, bool srgb = true)
type ITexture2D
params width [>0] The texture width, in texels.
  height [>0] The texture height, in texels.
  format [not-null] The texture format (will be returned by Format).
  mipmaps [>=0] The number of mipmap levels (including the full-resolution level). If 0 the number of levels will be inferred from width and height. Defaults to 1.
  data Create a texture data object (i.e. CanCopyTexels returns true)? Defaults to false.
  srgb The sRGB behaviour of the created texture (see IsSrgb). Defaults to true.
returns [not-null] The ITexture2D object.
inherited TextureFactory.CreateTexture2D

Remarks:

The given texture size is validated (see ValidateTextureSize) before the texture is created, so the size of the returned ITexture2D object might be different to width and/or height.

See also:

ITextureFactory.ValidateTextureSize
ITextureFactory.ValidateTextureFormat

Exceptions:

ValidateTextureFormat

Checks if this texture factory supports the given texture format. If not it returns a supported format that matches format as closely as possible.

[Pure]
public method ValidateTextureFormat (TextureFormat format)
type TextureFormat
params format The texture format.
returns [not-null] The supported texture format to use.
inherited TextureFactory.ValidateTextureFormat

ValidateTextureSize

Validates the given texture size by adjusting the width and height according to the texture size restrictions of this factory (e.g. must-be-square).

[Pure]
public method ValidateTextureSize (int32 width, int32 height)
type Vec2I
params width The texture width.
  height The texture height.
returns The validated texture size.
inherited TextureFactory.ValidateTextureSize