Class GraphicsDeviceExtensions
Defines a set of extension methods for the GraphicsDevice class.
public static class GraphicsDeviceExtensions
- Inheritance
-
objectGraphicsDeviceExtensions
Methods
DrawQuad(CommandList)
Draws a full-screen triangle with the currently applied Effect.
public static void DrawQuad(this CommandList commandList)
Parameters
commandListCommandListThe 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
graphicsContextGraphicsContextThe graphics context used for drawing.
effectInstanceEffectInstanceThe Effect instance to apply when drawing the triangle.
Exceptions
- ArgumentNullException
effectInstanceis 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
graphicsContextGraphicsContextThe graphics context used for drawing.
textureTextureThe Texture to draw.
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.
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
graphicsContextGraphicsContextThe graphics context used 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.
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
graphicsContextGraphicsContextThe graphics context used for drawing.
textureTextureThe Texture to draw.
samplerStateSamplerStateThe Sampler State to use for sampling the texture. Specify null to use the default Sampler State LinearClamp.
blendStateBlendStateDescription?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
graphicsContextGraphicsContextThe graphics context used for drawing.
textureTextureThe Texture to draw.
blendStateBlendStateDescription?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
deviceGraphicsDeviceThe Graphics Device for which to retrieve the shared white Texture.