Class GorgonDrawIndexCallBuilder
A builder class used to create indexed draw calls using fluent calls.
Inheritance
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonDrawIndexCallBuilder : GorgonDrawCallBuilderCommon<GorgonDrawIndexCallBuilder, GorgonDrawIndexCall>, IGorgonFluentBuilderAllocator<GorgonDrawIndexCallBuilder, GorgonDrawIndexCall, IGorgonAllocator<GorgonDrawIndexCall>>, IGorgonFluentBuilder<GorgonDrawIndexCallBuilder, GorgonDrawIndexCall>
Remarks
The draw call builder object allow applications to build the immutable draw call objects needed to send data and state information to the GPU.
A draw call is an immutable object that contains all of the state required to render mesh information. For each mesh an application needs to render, an single draw call should be issued via the Submit(GorgonDrawIndexCall, in GorgonColor?, int, int) method.
State management is handled internally by Gorgon so that duplicate states are not set and thus, performance is not impacted by redundant states.
Because a draw call is immutable, it is not possible to modify a draw call after it's been created. However, a copy of a draw call can be created using the ResetTo(TDc) method on the this object. Or, the builder can be modified after the creation of your draw call that needs to be updated and a new call may be built then.
This builder type uses a fluent interface to assemble the draw call, its resources and its GorgonPipelineState.
Constructors
| Edit this page View SourceGorgonDrawIndexCallBuilder()
Initializes a new instance of the GorgonDrawIndexCallBuilder class.
Declaration
public GorgonDrawIndexCallBuilder()
See Also
Methods
| Edit this page View SourceBaseVertexIndex(int)
Function to set the base vertex index.
Declaration
public GorgonDrawIndexCallBuilder BaseVertexIndex(int baseVertexIndex)
Parameters
Type | Name | Description |
---|---|---|
int | baseVertexIndex | The base vertex index to set. |
Returns
Type | Description |
---|---|
GorgonDrawIndexCallBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceIndexBuffer(GorgonIndexBuffer, int, int?)
Function to assign an index buffer to the draw call.
Declaration
public GorgonDrawIndexCallBuilder IndexBuffer(GorgonIndexBuffer buffer, int indexStart = 0, int? indexCount = null)
Parameters
Type | Name | Description |
---|---|---|
GorgonIndexBuffer | buffer | The buffer to assign. |
int | indexStart | [Optional] The first index in the index buffer to render. |
int? | indexCount | [Optional] The number of indices to render. |
Returns
Type | Description |
---|---|
GorgonDrawIndexCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the -or- Thrown when the |
See Also
| Edit this page View SourceIndexRange(int, int)
Function to set the first index, and the number of indices to render in the draw call.
Declaration
public GorgonDrawIndexCallBuilder IndexRange(int indexStart, int indexCount)
Parameters
Type | Name | Description |
---|---|---|
int | indexStart | The first index in the index buffer to render. |
int | indexCount | The number of indices to render. |
Returns
Type | Description |
---|---|
GorgonDrawIndexCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the -or- Thrown when the |
See Also
| Edit this page View SourceOnClear()
Function to clear the draw call.
Declaration
protected override GorgonDrawIndexCallBuilder OnClear()
Returns
Type | Description |
---|---|
GorgonDrawIndexCallBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceOnCreate(IGorgonAllocator<GorgonDrawIndexCall>)
Function to create a new draw call.
Declaration
protected override GorgonDrawIndexCall OnCreate(IGorgonAllocator<GorgonDrawIndexCall> allocator)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAllocator<GorgonDrawIndexCall> | allocator | The allocator to use when creating draw call objects. |
Returns
Type | Description |
---|---|
GorgonDrawIndexCall | A new draw call. |
Overrides
See Also
| Edit this page View SourceOnResetTo(GorgonDrawIndexCall)
Function to reset the properties of the draw call to the draw call passed in.
Declaration
protected override GorgonDrawIndexCallBuilder OnResetTo(GorgonDrawIndexCall drawCall)
Parameters
Type | Name | Description |
---|---|---|
GorgonDrawIndexCall | drawCall | The draw call to copy from. |
Returns
Type | Description |
---|---|
GorgonDrawIndexCallBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceOnUpdate(GorgonDrawIndexCall)
Function to update the properties of the draw call from the working copy to the final copy.
Declaration
protected override void OnUpdate(GorgonDrawIndexCall finalCopy)
Parameters
Type | Name | Description |
---|---|---|
GorgonDrawIndexCall | finalCopy | The object representing the finalized copy. |