Skip to content

GraphicsAPI reference

Struct RenderState

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Graphics2D.dll
Guide: Graphics

The per-draw state of the 2D batcher (State): blend, sampler and scissor.

C#
public readonly struct RenderState : IEquatable<RenderState>

Implements

IEquatable<RenderState>

Constructors

RenderState(BlendState, SamplerDescription, RectI?)

The per-draw state of the 2D batcher (State): blend, sampler and scissor.

C#
public RenderState(BlendState Blend, SamplerDescription Sampler, RectI? Scissor)

Parameters

Blend BlendState

Blend state; the built-in presets work on every device.

Sampler SamplerDescription

Sampler of the draws’ textures.

Scissor RectI?

Scissor in target pixels; null draws on the whole viewport.

Properties

Blend

Blend state; the built-in presets work on every device.

C#
public BlendState Blend { get; init; }

Property Value

BlendState

Default

Premultiplied alpha blending, nearest clamped sampling, no scissor.

C#
public static RenderState Default { get; }

Property Value

RenderState

Sampler

Sampler of the draws’ textures.

C#
public SamplerDescription Sampler { get; init; }

Property Value

SamplerDescription

Scissor

Scissor in target pixels; null draws on the whole viewport.

C#
public RectI? Scissor { get; init; }

Property Value

RectI?

Methods

Deconstruct(out BlendState, out SamplerDescription, out RectI?)

C#
public void Deconstruct(out BlendState Blend, out SamplerDescription Sampler, out RectI? Scissor)

Parameters

Blend BlendState

Sampler SamplerDescription

Scissor RectI?

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(RenderState)

C#
public bool Equals(RenderState other)

Parameters

other RenderState

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(RenderState, RenderState)

C#
public static bool operator ==(RenderState left, RenderState right)

Parameters

left RenderState

right RenderState

Returns

bool

operator !=(RenderState, RenderState)

C#
public static bool operator !=(RenderState left, RenderState right)

Parameters

left RenderState

right RenderState

Returns

bool