Texture2D

Description

abstract class Tinman.Terrain.Rendering.Texture2D

Derived from

ResourceBase abstract
ITexture2D

Extended by

DirectX9Texture2D sealed

Abstract base class for ITexture2D implementations.

Protected / Constructors

Texture2​D


protected constructor Texture2D → (7)

width in : int32

[>0]
The texture width, in texels.

height in : int32

[>0]
The texture height, in texels.

mipmaps in : int32

[>=0]
The number of mipmap levels.If 0 the number of levels will be inferred from width in and height in.

format in : TextureFormat

[not-null]
The texture format.

srgb in : bool

The sRGB behaviour

accessPattern in : ResourceAccessPattern

The resource access pattern.

count in : int32

[>=1]
The number of texture array slices.

Creates a new instance of Texture2D.

Protected / Methods

Block​Align


[Pure]
protected method BlockAlign → (1)

value opt : int32 = 0

The value to align with the block size of the texture format. Passing 0 will return the block size.

returns → int32

The aligned value, which will be greater than or equal to the original value opt.

Aligns the given value opt to the block size of the texture format.

Buffer


protected method Buffer → (2)

data in : IntPtr

Points to the first byte of the memory block.

capacity in : int32

The memory block size, in bytes.

returns → ByteBuffer

The raw byte buffer.

Returns a raw byte buffer that wraps the given memory block.

Do​Set​Texels


protected method DoSetTexels → (6)

source in : TexelBuffer

The source data of the texture update.

targetIdx in : int32

The target texture slice (always within range).

targetX in : int32

The target X-coordinate (aligned the mipmap chain).

targetY in : int32

The target Y-coordinate (aligned the mipmap chain).

targetWidth in : int32

The target width (always greater than zero).

targetHeight in : int32

The target height (always greater than zero).

returns → bool

true if the texture update was successful,
false if it has failed.

Updates a region of this texture.

The value of ITexture.Mipmaps and ITexelBufferInfo.MipmapCount of source in should be identical. Otherwise, some texture mipmap levels will not be updated or some buffer mipmaps will not be used.

Do​Set​Texels_​Begin


[EmptyBody]
protected virtual method DoSetTexels_Begin → (2)

width in : int32

Width of the texture update rectangle.

height in : int32

Height of the texture update rectangle.

returns → bool

true if the texture update has begun and must be completed by subsequent calls to DoSetTexels_Region, followed by a final call to DoSetTexels_End,
false if the texture update is not possible and must be skipped.

Called by DoSetTexels to begin the texture update.

Do​Set​Texels_​End


[EmptyBody]
protected virtual method DoSetTexels_End → ()

Called by DoSetTexels to finish the texture update.

Do​Set​Texels_​Region


protected abstract method DoSetTexels_Region → (7)

level in : int32

The mipmap level.

buffer in : TexelBuffer

The texel buffer for level in.

targetIdx in : int32

The target texture slice.

targetX in : int32

The target X-coordinate (always aligned with block size).

targetY in : int32

The target Y-coordinate (always aligned with block size).

targetWidth in : int32

The target width (always greater than zero).

targetHeight in : int32

The target height (always greater than zero).

returns → bool

true if the texture update has succeeded,
false if is has failed.

Called by DoSetTexels for each mipmap level.

Is​Mipmap​Aligned


[Pure]
protected method IsMipmapAligned → (1)

value in : int32

The coordinate / size to check.

returns → bool

true if value in is aligned with the mipmap chain,
false if it is misaligned.

Checks if the given coordinate / size is aligned with the mipmap chain.

Protected / Attributes

count


protected readonly attribute count → (int32)

The number of texture array slices.

format


protected attribute format → (TextureFormat)

The texture format.

height


protected readonly attribute height → (int32)

The texture height.

mipmaps


protected readonly attribute mipmaps → (int32)

The number of mipmap levels.

width


protected readonly attribute width → (int32)

The texture width.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.