IBufferFactory

Description

interface Tinman.Terrain.Rendering.IBufferFactory

Extended by

BufferFactory abstract

Base interface for classes that create buffer resources for rendering.

Public / Methods

CreateIndexBuffer


[OwnerReturn]
public method CreateIndexBuffer → (2)

capacity in : int32

[>0]
The capacity of the index buffer, in vertex indices.

flags in : GpuBufferFlags

The buffer flags.

returns → IIndexBuffer

The IIndexBuffer object.

Creates an IIndexBuffer object with ResourceAccessPattern.Dynamic or ResourceAccessPattern.Mappable access, depending on the given buffer flags in.

RenderException

If a graphics subsystem error has occurred.

CreateIndexBufferStatic


[OwnerReturn]
public method CreateIndexBufferStatic → (3)

indices in : int32 [ ]

[not-null]
The index buffer content.

offset opt : int32 = 0

[>=0]
Offset to first vertex index in indices in.

count opt : int32 = 0

[>=0]
Total number of vertex indices. If 0, all remaining vertex indices will be used.

returns → IIndexBuffer

The IIndexBuffer object.

Creates an IIndexBuffer object with ResourceAccessPattern.Static access.

RenderException

If a graphics subsystem error has occurred.

CreateStructuredBuffer


[OwnerReturn]
public method CreateStructuredBuffer → (3)

elementSize in : int32

[>=0]
The element size of the structured buffer, see IGpuBuffer.ElementSize. If 0, the element size will be inferred from the given behaviour flags in. Set elementSize in to 0 and flags in to GpuBufferFlags.None or GpuBufferFlags.Update in order to create a buffer with unspecified structure, to be used as a raw byte buffer.

capacity in : int32

[>0]
The capacity of the structured buffer, see ICapacity.Capacity.

flags in : GpuBufferFlags

The buffer flags.

returns → IGpuBuffer

The IGpuBuffer object.

Creates an IGpuBuffer object with ResourceAccessPattern.Dynamic or ResourceAccessPattern.Mappable access, depending on the given buffer flags in.

RenderException

If a graphics subsystem error has occurred.

CreateStructuredBufferStatic


[OwnerReturn]
public method CreateStructuredBufferStatic → (2)

elementSize in : int32

[>=0]
The element-size of the structured buffer, see IGpuBuffer.ElementSize. Set to 0 in order to create a buffer with unspecified structure, to be used as a raw byte buffer.

content in : ByteBuffer

[not-null]
The buffer contents.

returns → IGpuBuffer

The IGpuBuffer object.

Creates an IGpuBuffer object with ResourceAccessPattern.Static access.

The capacity (see ICapacity.Capacity) of the returned structured buffer is equal to floor(BS/ES), where BS is the buffer size (see ByteBuffer.Remaining) and ES is the element size (see elementSize in). If ES is zero, the capacity of the structured buffer is equal to the buffer size BS.

RenderException

If a graphics subsystem error has occurred.

CreateVertexBuffer


[OwnerReturn]
public method CreateVertexBuffer → (3)

format in : VertexElements

[not-null]
The vertex format.

capacity in : int32

[>0]
The capacity of the vertex buffer, in vertices.

flags in : GpuBufferFlags

The buffer flags.

returns → IVertexBuffer

The IVertexBuffer object.

Creates an IVertexBuffer object with ResourceAccessPattern.Dynamic or ResourceAccessPattern.Mappable access, depending on the given buffer flags in.

RenderException

If a graphics subsystem error has occurred.

CreateVertexBufferStatic


[OwnerReturn]
public method CreateVertexBufferStatic → (2)

format in : VertexElements

[not-null]
The vertex buffer format.

content in : ByteBuffer

[not-null]
The vertex buffer contents.

returns → IVertexBuffer

The IVertexBuffer object.

Creates an IVertexBuffer object with ResourceAccessPattern.Static access.

The capacity (see ICapacity.Capacity) of the returned vertex buffer is equal to floor(BS/VS), where BS is the buffer size (see ByteBuffer.Remaining) and VS is the vertex size (see VertexElements.SizeAligned).

RenderException

If a graphics subsystem error has occurred.

ValidateStructuredBuffer


public method ValidateStructuredBuffer → (3)

elementSize in : int32

The element size of the structured buffer, see IGpuBuffer.ElementSize. If 0, the element size will be inferred from the given behaviour flags in. Set elementSize in to 0 and flags in to GpuBufferFlags.None or GpuBufferFlags.Update in order to create a buffer with unspecified structure, to be used as a raw byte buffer.

capacity in : int32

The capacity of the structured buffer, see ICapacity.Capacity.

flags in : GpuBufferFlags

The buffer flags.

returns → bool

true if a structured buffer may be created (either static or dynamic),
false if the creation of such structured buffers is not supported.

Validates if a structured buffer can be created using the given arguments.

ValidateVertexElement


public method ValidateVertexElement → (1)

element in : VertexElement

[not-null]
The vertex element.

returns → bool

true if element in may be used to create vertex buffers,
false if such vertex elements are not supported.

Validates if the given vertex element may be used to create vertex buffers.

Public / Attributes

CanCreateStructuredBuffer


public attribute CanCreateStructuredBuffer → (get)

value : bool

true if this graphics context supports structured buffers,
false if not.

Can this graphics context be used to create IGpuBuffer resources?