Gorgon
Show / Hide Table of Contents

Class Gorgon2DBatchStateBuilder

A builder which will buld Gorgon2DBatchState objects to pass to the Begin(Gorgon2DBatchState, GorgonCameraCommon) method.

Inheritance
object
Gorgon2DBatchStateBuilder
Implements
IGorgonFluentBuilderAllocator<Gorgon2DBatchStateBuilder, Gorgon2DBatchState, IGorgonAllocator<Gorgon2DBatchState>>
IGorgonFluentBuilder<Gorgon2DBatchStateBuilder, Gorgon2DBatchState>
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
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 Source

BlendFactor(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

BlendSampleMask(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

BlendState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

BlendState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

Build()

Function to return the object.

Declaration
public Gorgon2DBatchState Build()
Returns
Type Description
Gorgon2DBatchState

The object created or updated by this builder.

See Also
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

Build(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

Clear()

Function to clear the builder to a default state.

Declaration
public Gorgon2DBatchStateBuilder Clear()
Returns
Type Description
Gorgon2DBatchStateBuilder

The fluent builder interface.

See Also
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

DepthStencilState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

DepthStencilState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

PixelShaderState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

PixelShaderState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

RasterState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

RasterState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

ResetShader(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

ResetTo(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

StencilReferenceValue(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

VertexShaderState(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
Gorgon2DBatchState
Gorgon2D
| Edit this page View Source

VertexShaderState(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.

See Also
Gorgon2DBatchState
Gorgon2D

Implements

IGorgonFluentBuilderAllocator<TB, TBo, TBa>
IGorgonFluentBuilder<TB, TBo>

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)

See Also

Gorgon2DBatchState
Gorgon2D
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author