Gorgon
Show / Hide Table of Contents

Class GorgonSamplerStateBuilder

A builder for a GorgonSamplerState.

Inheritance
object
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>
GorgonSamplerStateBuilder
Implements
IGorgonFluentBuilder<GorgonSamplerStateBuilder, GorgonSamplerState>
IGorgonGraphicsObject
Inherited Members
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.WorkingState
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.OnCreateState()
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.OnResetTo(GorgonSamplerState)
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.OnClearState()
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.Build()
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.ResetTo(GorgonSamplerState)
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.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 GorgonSamplerStateBuilder : GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>, IGorgonFluentBuilder<GorgonSamplerStateBuilder, GorgonSamplerState>, IGorgonGraphicsObject
Remarks

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

This will define how a texture is sampled inside of a shader when rendering. Filtering, addressing, etc... are all defined in this state.

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

Unlike the other state builders, this builder does not offer the optional use of a GorgonStateBuilderPoolAllocator<T>. This is because the state is cached internally and does not need an allocator pool.

Constructors

| Edit this page View Source

GorgonSamplerStateBuilder(GorgonGraphics)

Initializes a new instance of the GorgonSamplerStateBuilder class.

Declaration
public GorgonSamplerStateBuilder(GorgonGraphics graphics)
Parameters
Type Name Description
GorgonGraphics graphics

The graphics interface used to build sampler states.

See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState

Properties

| Edit this page View Source

Graphics

Property to return the graphics interface that built this object.

Declaration
public GorgonGraphics Graphics { get; }
Property Value
Type Description
GorgonGraphics
See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState

Methods

| Edit this page View Source

ComparisonFunction(Comparison)

Function to set the function to compare sampled data.

Declaration
public GorgonSamplerStateBuilder ComparisonFunction(Comparison compare)
Parameters
Type Name Description
Comparison compare

The function used for comparison.

Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState
| Edit this page View Source

Filter(SampleFilter)

Function to set the type of filtering to apply to the texture.

Declaration
public GorgonSamplerStateBuilder Filter(SampleFilter filter)
Parameters
Type Name Description
SampleFilter filter

The filter to apply.

Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState
| Edit this page View Source

MaxAnisotropy(int)

Function to set the value used to clamp an anisotropic texture filter.

Declaration
public GorgonSamplerStateBuilder MaxAnisotropy(int maxAnisotropy)
Parameters
Type Name Description
int maxAnisotropy

The maximum anisotropy value.

Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState
| Edit this page View Source

MipLevelOfDetail(float?, float?, float?)

Function to set the minimum/maximum mip level of detail to use.

Declaration
public GorgonSamplerStateBuilder MipLevelOfDetail(float? min = null, float? max = null, float? mipLodBias = null)
Parameters
Type Name Description
float? min

[Optional] The lower end of the mip map range to clamp access to

float? max

[Optional] the higher end of the mip map range to clamp access to

float? mipLodBias

[Optional] The mip map level of detail bias value.

Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

Remarks

If all parameters are set to null (i.e. omitted), then the corresponding values will be reset to their defaults.

See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState
| Edit this page View Source

OnClearState()

Function to clear the working state for the builder.

Declaration
protected override GorgonSamplerStateBuilder OnClearState()
Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

Overrides
GorgonStateBuilderCommon<GorgonSamplerStateBuilder, GorgonSamplerState>.OnClearState()
See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState
| 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 GorgonSamplerState OnCreateState()
Returns
Type Description
GorgonSamplerState

The new render state.

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

OnResetTo(GorgonSamplerState)

Function to reset the builder to the specified state.

Declaration
protected override GorgonSamplerStateBuilder OnResetTo(GorgonSamplerState state)
Parameters
Type Name Description
GorgonSamplerState state

The state to copy from.

Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

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

Wrapping(TextureWrap?, TextureWrap?, TextureWrap?, in GorgonColor?)

Function to set the wrapping mode for a texture.

Declaration
public GorgonSamplerStateBuilder Wrapping(TextureWrap? wrapU = null, TextureWrap? wrapV = null, TextureWrap? wrapW = null, in GorgonColor? borderColor = null)
Parameters
Type Name Description
TextureWrap? wrapU

[Optional] The horizontal wrapping type.

TextureWrap? wrapV

[Optional] The vertical wrapping type.

TextureWrap? wrapW

[Optional] The depth wrapping type.

GorgonColor? borderColor

[Optional] The color of the border when the wrapping type for any axis is set to Border.

Returns
Type Description
GorgonSamplerStateBuilder

The fluent builder interface.

Remarks

If all parameters are set to null (i.e. omitted), then the corresponding values will be reset to their defaults.

See Also
GorgonGraphics
GorgonPipelineState
GorgonSamplerState

Implements

IGorgonFluentBuilder<TB, TBo>
IGorgonGraphicsObject

Extension Methods

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

See Also

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