Class Gorgon2DBatchStateBuilder
A builder which will buld Gorgon2DBatchState objects to pass to the Begin(Gorgon2DBatchState, GorgonCameraCommon) method.
Implements
Inherited Members
Namespace: Gorgon.Renderers
Assembly: Gorgon.Renderers.Gorgon2D.dll
Syntax
public class Gorgon2DBatchStateBuilder : IGorgonFluentBuilderAllocator<Gorgon2DBatchStateBuilder, Gorgon2DBatchState, IGorgonAllocator<Gorgon2DBatchState>>, IGorgonFluentBuilder<Gorgon2DBatchStateBuilder, Gorgon2DBatchState>
Methods
| Edit this page View SourceBlendFactor(GorgonColor)
Function to assign a blending factor used to modulate with the pixel shader, current render target or both.
Declaration
public Gorgon2DBatchStateBuilder BlendFactor(GorgonColor factor)
Parameters
Type | Name | Description |
---|---|---|
GorgonColor | factor | The blending factor. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
Remarks
This property is read/write on the Gorgon2DBatchState, so it can be changed at any time.
The default value is White.
See Also
| Edit this page View SourceBlendSampleMask(int)
Function to assign the mask used to define which samples get updated in the active render target(s).
Declaration
public Gorgon2DBatchStateBuilder BlendSampleMask(int mask)
Parameters
Type | Name | Description |
---|---|---|
int | mask | The mask value. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
Remarks
This property is read/write on the Gorgon2DBatchState, so it can be changed at any time.
The default value is MinValue.
See Also
| Edit this page View SourceBlendState(GorgonBlendState)
Function to assign the blend state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder BlendState(GorgonBlendState blendState)
Parameters
Type | Name | Description |
---|---|---|
GorgonBlendState | blendState | The blend state to assign, or null for a default state. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceBlendState(GorgonBlendStateBuilder)
Function to assign the blend state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder BlendState(GorgonBlendStateBuilder blendState)
Parameters
Type | Name | Description |
---|---|---|
GorgonBlendStateBuilder | blendState | The blend state to assign, or null for a default state. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceBuild()
Function to return the object.
Declaration
public Gorgon2DBatchState Build()
Returns
Type | Description |
---|---|
Gorgon2DBatchState | The object created or updated by this builder. |
See Also
| Edit this page View SourceBuild(IGorgonAllocator<Gorgon2DBatchState>)
Function to return the object.
Declaration
public Gorgon2DBatchState Build(IGorgonAllocator<Gorgon2DBatchState> allocator)
Parameters
Type | Name | Description |
---|---|---|
IGorgonAllocator<Gorgon2DBatchState> | allocator | The allocator used to create an instance of the object |
Returns
Type | Description |
---|---|
Gorgon2DBatchState | The object created or updated by this builder. |
Remarks
Using an allocator
can provide different strategies when building objects. If omitted, the object will be created using the standard new keyword.
A custom allocator can be beneficial because it allows us to use a pool for allocating the objects, and thus allows for recycling of objects. This keeps the garbage collector happy by keeping objects around for as long as we need them, instead of creating objects that can potentially end up in the large object heap or in Gen 2.
See Also
| Edit this page View SourceClear()
Function to clear the builder to a default state.
Declaration
public Gorgon2DBatchStateBuilder Clear()
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceDepthStencilState(GorgonDepthStencilState)
Function to assign a depth/stencil state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder DepthStencilState(GorgonDepthStencilState depthStencilState)
Parameters
Type | Name | Description |
---|---|---|
GorgonDepthStencilState | depthStencilState | The depth/stencil state to assign, or null for a default state. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceDepthStencilState(GorgonDepthStencilStateBuilder)
Function to assign a depth/stencil state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder DepthStencilState(GorgonDepthStencilStateBuilder depthStencilState)
Parameters
Type | Name | Description |
---|---|---|
GorgonDepthStencilStateBuilder | depthStencilState | The depth/stencil state to assign, or null for a default state. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourcePixelShaderState(Gorgon2DShaderStateBuilder<GorgonPixelShader>)
Function to assign a pixel shader state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder PixelShaderState(Gorgon2DShaderStateBuilder<GorgonPixelShader> shader)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2DShaderStateBuilder<GorgonPixelShader> | shader | The pixel shader and resources to assign, or null for a default pixel shader and states. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourcePixelShaderState(Gorgon2DShaderState<GorgonPixelShader>)
Function to assign a pixel shader state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder PixelShaderState(Gorgon2DShaderState<GorgonPixelShader> shader)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2DShaderState<GorgonPixelShader> | shader | The pixel shader and resources to assign, or null for a default pixel shader and states. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceRasterState(GorgonRasterState)
Function to assign a raster state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder RasterState(GorgonRasterState rasterState)
Parameters
Type | Name | Description |
---|---|---|
GorgonRasterState | rasterState | The raster state to assign, or null for a default state. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceRasterState(GorgonRasterStateBuilder)
Function to assign a raster state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder RasterState(GorgonRasterStateBuilder rasterState)
Parameters
Type | Name | Description |
---|---|---|
GorgonRasterStateBuilder | rasterState | The raster state to assign, or null for a default state. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceResetShader(ShaderType)
Function to reset the specified shader type to the default state.
Declaration
public Gorgon2DBatchStateBuilder ResetShader(ShaderType shaderType)
Parameters
Type | Name | Description |
---|---|---|
ShaderType | shaderType | The type of shader to reset. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceResetTo(Gorgon2DBatchState)
Function to reset the builder to the specified object state.
Declaration
public Gorgon2DBatchStateBuilder ResetTo(Gorgon2DBatchState builderObject = null)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2DBatchState | builderObject | [Optional] The specified object state to copy. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceStencilReferenceValue(int)
Function to assign the stencil reference value used when performing a stencil test.
Declaration
public Gorgon2DBatchStateBuilder StencilReferenceValue(int value)
Parameters
Type | Name | Description |
---|---|---|
int | value | The stencil reference value. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
Remarks
This property is read/write on the Gorgon2DBatchState, so it can be changed at any time.
The default value is 0.
See Also
| Edit this page View SourceVertexShaderState(Gorgon2DShaderStateBuilder<GorgonVertexShader>)
Function to assign a vertex shader state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder VertexShaderState(Gorgon2DShaderStateBuilder<GorgonVertexShader> shader)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2DShaderStateBuilder<GorgonVertexShader> | shader | The vertex shader and resources to assign, or null for a default vertex shader and states. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |
See Also
| Edit this page View SourceVertexShaderState(Gorgon2DShaderState<GorgonVertexShader>)
Function to assign a vertex shader state to the batch state.
Declaration
public Gorgon2DBatchStateBuilder VertexShaderState(Gorgon2DShaderState<GorgonVertexShader> shader)
Parameters
Type | Name | Description |
---|---|---|
Gorgon2DShaderState<GorgonVertexShader> | shader | The vertex shader and resources to assign, or null for a default vertex shader and states. |
Returns
Type | Description |
---|---|
Gorgon2DBatchStateBuilder | The fluent builder interface. |