Class PrimitiveQuad
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
-
objectPrimitiveQuad
- Implements
- Inherited Members
- Extension Methods
Constructors
PrimitiveQuad(GraphicsDevice)
Initializes a new instance of the PrimitiveQuad class.
public PrimitiveQuad(GraphicsDevice graphicsDevice)
Parameters
graphicsDeviceGraphicsDeviceThe Graphics Device.
Fields
PrimitiveType
The type of primitives used to draw the triangle.
public static readonly PrimitiveType PrimitiveType
Field Value
VertexDeclaration
The definition of the layout of the vertices used to draw the triangle.
public static readonly VertexDeclaration VertexDeclaration
Field Value
Properties
GraphicsDevice
Gets the Graphics Device.
public GraphicsDevice GraphicsDevice { get; }
Property Value
Parameters
Gets the parameters used by the default Effect used to draw.
public ParameterCollection Parameters { get; }
Property Value
Methods
Draw(CommandList)
Draws a full-screen triangle.
public void Draw(CommandList commandList)
Parameters
commandListCommandListThe 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
graphicsContextGraphicsContextThe graphics context to use for drawing.
textureTextureThe Texture to draw.
samplerStateSamplerStateThe Sampler State to use for sampling the texture. Specify null to use the default Sampler State LinearClamp.
colorColor4The color to tint the Texture with. The final color will be the texture color multiplied by the specified color.
blendStateBlendStateDescription?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
graphicsContextGraphicsContextThe graphics context to use for drawing.
textureTextureThe Texture to draw.
blendStateBlendStateDescription?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
graphicsContextGraphicsContextThe graphics context to use for drawing.
effectInstanceEffectInstanceThe Effect instance to use for drawing. It must define a Pixel Shader having the signature
float2 : TEXCOORD.