Table of Contents

Class GraphicsDeviceExtensions

Namespace
Stride.Graphics
Assembly
Stride.Graphics.dll

Defines a set of extension methods for the GraphicsDevice class.

public static class GraphicsDeviceExtensions
Inheritance
object
GraphicsDeviceExtensions

Methods

DrawQuad(CommandList)

Draws a full-screen triangle with the currently applied Effect.

public static void DrawQuad(this CommandList commandList)

Parameters

commandList CommandList

The Command List to use to draw the full-screen triangle.

DrawQuad(GraphicsContext, EffectInstance)

Draws a full-screen triangle with the specified effect.

public static void DrawQuad(this GraphicsContext graphicsContext, EffectInstance effectInstance)

Parameters

graphicsContext GraphicsContext

The graphics context used for drawing.

effectInstance EffectInstance

The Effect instance to apply when drawing the triangle.

Exceptions

ArgumentNullException

effectInstance is null.

DrawTexture(GraphicsContext, Texture, Color4, BlendStateDescription?)

Draws a full-screen tinted Texture using a LinearClamp Sampler.

public static void DrawTexture(this GraphicsContext graphicsContext, Texture texture, Color4 color, BlendStateDescription? blendState = null)

Parameters

graphicsContext GraphicsContext

The graphics context used for drawing.

texture Texture

The Texture to draw.

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.

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

Draws a full-screen tinted Texture using the specified Sampler.

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

Parameters

graphicsContext GraphicsContext

The graphics context used 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.

DrawTexture(GraphicsContext, Texture, SamplerState, BlendStateDescription?)

Draws a full-screen Texture using the specified sampler.

public static void DrawTexture(this GraphicsContext graphicsContext, Texture texture, SamplerState samplerState, BlendStateDescription? blendState = null)

Parameters

graphicsContext GraphicsContext

The graphics context used 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.

blendState BlendStateDescription?

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

DrawTexture(GraphicsContext, Texture, BlendStateDescription?)

Draws a full-screen Texture using a LinearClamp Sampler.

public static void DrawTexture(this GraphicsContext graphicsContext, Texture texture, BlendStateDescription? blendState = null)

Parameters

graphicsContext GraphicsContext

The graphics context used 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.

GetSharedWhiteTexture(GraphicsDevice)

Gets or creates a shared 2x2 white Texture for the specified Graphics Device.

public static Texture GetSharedWhiteTexture(this GraphicsDevice device)

Parameters

device GraphicsDevice

The Graphics Device for which to retrieve the shared white Texture.

Returns

Texture

A Texture consisting of 2x2 white pixels.