Gorgon
Show / Hide Table of Contents

Class GorgonBlendStateBuilder

A builder for a GorgonBlendState object.

Inheritance
object
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>
GorgonStateBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState>
GorgonBlendStateBuilder
Implements
IGorgonFluentBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState, IGorgonAllocator<GorgonBlendState>>
IGorgonFluentBuilder<GorgonBlendStateBuilder, GorgonBlendState>
Inherited Members
GorgonStateBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState>.OnUpdate(GorgonBlendState)
GorgonStateBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState>.Build(IGorgonAllocator<GorgonBlendState>)
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.WorkingState
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.OnCreateState()
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.OnResetTo(GorgonBlendState)
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.OnClearState()
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.Build()
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.ResetTo(GorgonBlendState)
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.Clear()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Graphics.Core
Assembly: Gorgon.Graphics.Core.dll
Syntax
public class GorgonBlendStateBuilder : GorgonStateBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState>, IGorgonFluentBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState, IGorgonAllocator<GorgonBlendState>>, IGorgonFluentBuilder<GorgonBlendStateBuilder, GorgonBlendState>
Remarks

Use this builder to create a new immutable GorgonBlendState to pass to a GorgonPipelineState. This object provides a fluent interface to help build up a blend state.

A blend state will define how rasterized data is blended with the current render target(s). The ability to disable blending, define how blending operations are performed, etc... are all done through this state. This state also defines how blending is performed between adjacent render target(s) in the RenderTargets. This is controlled by the IsIndependentBlendingEnabled flag on the GorgonPipelineState object.

A blend state is an immutable object, and as such can only be created by using this object.

Constructors

| Edit this page View Source

GorgonBlendStateBuilder()

Initializes a new instance of the GorgonBlendStateBuilder class.

Declaration
public GorgonBlendStateBuilder()
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState

Methods

| Edit this page View Source

BlendOperation(BlendOperation?, BlendOperation?)

Function to set the color, and alpha blend operations.

Declaration
public GorgonBlendStateBuilder BlendOperation(BlendOperation? color = null, BlendOperation? alpha = null)
Parameters
Type Name Description
BlendOperation? color

[Optional] The color blend operation to assign.

BlendOperation? alpha

[Optional] The alpha blend operation to assign.

Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

DestinationBlend(Blend?, Blend?)

Function to set the color, and alpha destination blend operation.

Declaration
public GorgonBlendStateBuilder DestinationBlend(Blend? color = null, Blend? alpha = null)
Parameters
Type Name Description
Blend? color

[Optional] The color blend operation to assign.

Blend? alpha

[Optional] The alpha blend operation to assign.

Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

DisableBlending()

Function to disable blending.

Declaration
public GorgonBlendStateBuilder DisableBlending()
Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

EnableBlending()

Function to enable blending.

Declaration
public GorgonBlendStateBuilder EnableBlending()
Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

LogicOperation(LogicOperation)

Function to set the logical blending operation.

Declaration
public GorgonBlendStateBuilder LogicOperation(LogicOperation logicOperation)
Parameters
Type Name Description
LogicOperation logicOperation

The operation to perform.

Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

OnClearState()

Function to clear the working state for the builder.

Declaration
protected override GorgonBlendStateBuilder OnClearState()
Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.OnClearState()
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

OnCreateState()

Function to update the properties of the state from the working copy to the final copy.

Declaration
protected override GorgonBlendState OnCreateState()
Returns
Type Description
GorgonBlendState

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.OnCreateState()
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

OnResetTo(GorgonBlendState)

Function to reset the builder to the specified state.

Declaration
protected override GorgonBlendStateBuilder OnResetTo(GorgonBlendState state)
Parameters
Type Name Description
GorgonBlendState state

The state to copy from.

Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonBlendStateBuilder, GorgonBlendState>.OnResetTo(GorgonBlendState)
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

OnUpdate(GorgonBlendState)

Function to update the properties of the state, allocated from an allocator, from the working copy.

Declaration
protected override void OnUpdate(GorgonBlendState state)
Parameters
Type Name Description
GorgonBlendState state

The state to update.

Overrides
GorgonStateBuilderAllocator<GorgonBlendStateBuilder, GorgonBlendState>.OnUpdate(GorgonBlendState)
See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

SourceBlend(Blend?, Blend?)

Function to set the color, and alpha source blend operation.

Declaration
public GorgonBlendStateBuilder SourceBlend(Blend? color = null, Blend? alpha = null)
Parameters
Type Name Description
Blend? color

[Optional] The color blend operation to assign.

Blend? alpha

[Optional] The alpha blend operation to assign.

Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState
| Edit this page View Source

WriteMask(WriteMask)

Function to set the write mask.

Declaration
public GorgonBlendStateBuilder WriteMask(WriteMask writeMask)
Parameters
Type Name Description
WriteMask writeMask

The write mask to apply.

Returns
Type Description
GorgonBlendStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonBlendState

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

GorgonGraphics
GorgonPipelineState
GorgonBlendState
  • 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