Table of Contents

Class PrimitiveQuad

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

A primitive triangle that can be used to draw a Texture or an Effect, commonly used to draw full-screen. This is directly accessible from the DrawQuad(GraphicsContext, EffectInstance) method.

public class PrimitiveQuad : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
object
PrimitiveQuad
Implements
Inherited Members
Extension Methods

Constructors

PrimitiveQuad(GraphicsDevice)

Initializes a new instance of the PrimitiveQuad class.

public PrimitiveQuad(GraphicsDevice graphicsDevice)

Parameters

graphicsDevice GraphicsDevice

The Graphics Device.

Fields

PrimitiveType

The type of primitives used to draw the triangle.

public static readonly PrimitiveType PrimitiveType

Field Value

PrimitiveType

VertexDeclaration

The definition of the layout of the vertices used to draw the triangle.

public static readonly VertexDeclaration VertexDeclaration

Field Value

VertexDeclaration

Properties

GraphicsDevice

Gets the Graphics Device.

public GraphicsDevice GraphicsDevice { get; }

Property Value

GraphicsDevice

Parameters

Gets the parameters used by the default Effect used to draw.

public ParameterCollection Parameters { get; }

Property Value

ParameterCollection

Methods

Draw(CommandList)

Draws a full-screen triangle.

public void Draw(CommandList commandList)

Parameters

commandList CommandList

The Command List to use for drawing.

Remarks

An Effect with a Pixel Shader having the signature float2 : TEXCOORD must have been applied before calling this method.

Draw(GraphicsContext, Texture, SamplerState, Color4, BlendStateDescription?)

Draws a full-screen triangle with a tinted Texture.

public void Draw(GraphicsContext graphicsContext, Texture texture, SamplerState samplerState, Color4 color, BlendStateDescription? blendState = null)

Parameters

graphicsContext GraphicsContext

The graphics context to use for drawing.

texture Texture

The Texture to draw.

samplerState SamplerState

The Sampler State to use for sampling the texture. Specify null to use the default Sampler State LinearClamp.

color Color4

The color to tint the Texture with. The final color will be the texture color multiplied by the specified color.

blendState BlendStateDescription?

An optional Blend State to use when drawing the Texture. Specify null to use Default.

Draw(GraphicsContext, Texture, BlendStateDescription?)

Draws a full-screen triangle with a Texture.

public void Draw(GraphicsContext graphicsContext, Texture texture, BlendStateDescription? blendState = null)

Parameters

graphicsContext GraphicsContext

The graphics context to use for drawing.

texture Texture

The Texture to draw.

blendState BlendStateDescription?

An optional Blend State to use when drawing the Texture. Specify null to use Default.

Remarks

The Texture will be sampled using the default Sampler State LinearClamp.

Draw(GraphicsContext, EffectInstance)

Draws a full-screen triangle.

public void Draw(GraphicsContext graphicsContext, EffectInstance effectInstance)

Parameters

graphicsContext GraphicsContext

The graphics context to use for drawing.

effectInstance EffectInstance

The Effect instance to use for drawing. It must define a Pixel Shader having the signature float2 : TEXCOORD.