Class GorgonDrawCallBuilder
A builder class used to create basic draw calls using fluent calls.
Inheritance
Implements
Inherited Members
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonDrawCallBuilder : GorgonDrawCallBuilderCommon<GorgonDrawCallBuilder, GorgonDrawCall>, IGorgonFluentBuilderAllocator<GorgonDrawCallBuilder, GorgonDrawCall, IGorgonAllocator<GorgonDrawCall>>, IGorgonFluentBuilder<GorgonDrawCallBuilder, GorgonDrawCall>
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(GorgonDrawCall, in GorgonColor?, int, int) methods.
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 SourceGorgonDrawCallBuilder()
Initializes a new instance of the GorgonDrawCallBuilder class.
Declaration
public GorgonDrawCallBuilder()
See Also
Methods
| Edit this page View SourceOnClear()
Function to clear the builder to a default state.
Declaration
protected override GorgonDrawCallBuilder OnClear()
Returns
Type | Description |
---|---|
GorgonDrawCallBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceOnCreate(IGorgonAllocator<GorgonDrawCall>)
Function to create a new draw call.
Declaration
protected override GorgonDrawCall OnCreate(IGorgonAllocator<GorgonDrawCall> allocator)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAllocator<GorgonDrawCall> | allocator | The allocator to use when creating draw call objects. |
Returns
Type | Description |
---|---|
GorgonDrawCall | A new draw call. |
Overrides
See Also
| Edit this page View SourceOnResetTo(GorgonDrawCall)
Function to reset the properties of the draw call to the draw call passed in.
Declaration
protected override GorgonDrawCallBuilder OnResetTo(GorgonDrawCall drawCall)
Parameters
Type | Name | Description |
---|---|---|
GorgonDrawCall | drawCall | The draw call to copy from. |
Returns
Type | Description |
---|---|
GorgonDrawCallBuilder | The fluent builder interface. |
Overrides
See Also
| Edit this page View SourceOnUpdate(GorgonDrawCall)
Function to update the properties of the draw call from the working copy to the final copy.
Declaration
protected override void OnUpdate(GorgonDrawCall finalCopy)
Parameters
Type | Name | Description |
---|---|---|
GorgonDrawCall | finalCopy | The object representing the finalized copy. |
Overrides
See Also
| Edit this page View SourceVertexRange(int, int)
Function to set the first vertex index, and the number of vertices to render in the draw call.
Declaration
public GorgonDrawCallBuilder VertexRange(int index, int count)
Parameters
Type | Name | Description |
---|---|---|
int | index | The index of the first vertex in the vertex buffer to render. |
int | count | The number of vertices to render. |
Returns
Type | Description |
---|---|
GorgonDrawCallBuilder | The fluent builder interface. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown when the -or- Thrown when the |