Table of Contents

Class DrawInformation

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll
[Guid("693ce632-7f2f-45de-93fe-18d88b37aa21")]
public class DrawInformation : RenderInformation
Inheritance
DrawInformation
Inherited Members

Constructors

DrawInformation(nint)

public DrawInformation(nint nativePtr)

Parameters

nativePtr nint

Methods

SetPixelConstantBuffer(DataStream)

Sets the constant buffer data from a SharpDX.DataStream for the Pixel stage.

public void SetPixelConstantBuffer(DataStream dataStream)

Parameters

dataStream DataStream

The DataStream that contains the constant buffer data

SetPixelConstantBuffer<T>(T)

Sets the constant buffer data from a struct value for the Pixel stage.

public void SetPixelConstantBuffer<T>(T value) where T : struct

Parameters

value T

Value of the constant buffer

Type Parameters

T

Type of the constant buffer

SetPixelConstantBuffer<T>(ref T)

Sets the constant buffer data from a struct value for the Pixel Stage.

public void SetPixelConstantBuffer<T>(ref T value) where T : struct

Parameters

value T

Value of the constant buffer

Type Parameters

T

Type of the constant buffer

SetPixelShader(Guid, PixelOptions)

Set the shader instructions for this transform.

public void SetPixelShader(Guid shaderId, PixelOptions pixelOptions)

Parameters

shaderId Guid

The resource id for the shader.

pixelOptions PixelOptions

Additional information provided to the renderer to indicate the operations the pixel shader does.

Remarks

If this call fails, the corresponding Effect instance is placed into an error state and will fail to Draw, it will place the context into an error state which can be retrieved through the ID2D1DeviceContext::EndDraw call.

Specifying pixelOptions other than D2D1_PIXEL_OPTIONS_NONE can enable the renderer to perform certain optimizations such as combining various parts of the effect graph together. If this information does not accurately describe the shader, indeterminate rendering artifacts can result.

SetResourceTexture(int, ResourceTexture)

Sets the resource texture corresponding to the given shader texture index.

public void SetResourceTexture(int textureIndex, ResourceTexture resourceTexture)

Parameters

textureIndex int

The index of the texture to be bound to the pixel shader.

resourceTexture ResourceTexture

The created resource texture.

SetVertexConstantBuffer(DataStream)

Sets the constant buffer data from a SharpDX.DataStream for the Vertex stage.

public void SetVertexConstantBuffer(DataStream dataStream)

Parameters

dataStream DataStream

The DataStream that contains the constant buffer data

SetVertexConstantBuffer<T>(T)

Sets the constant buffer data from a struct value for the Vertex stage.

public void SetVertexConstantBuffer<T>(T value) where T : struct

Parameters

value T

Value of the constant buffer

Type Parameters

T

Type of the constant buffer

SetVertexConstantBuffer<T>(ref T)

Sets the constant buffer data from a struct value for the Vertex Stage.

public void SetVertexConstantBuffer<T>(ref T value) where T : struct

Parameters

value T

Value of the constant buffer

Type Parameters

T

Type of the constant buffer

SetVertexProcessing(VertexBuffer, VertexOptions, BlendDescription?, VertexRange?, Guid?)

Sets a vertex buffer, a corresponding vertex shader, and options to control how the vertices are to be handled by the Direct2D context.

public void SetVertexProcessing(VertexBuffer vertexBuffer, VertexOptions vertexOptions, BlendDescription? blendDescription = null, VertexRange? vertexRange = null, Guid? vertexShader = null)

Parameters

vertexBuffer VertexBuffer

The vertex buffer, if this is cleared, the default vertex shader and mapping to the transform rectangles will be used.

vertexOptions VertexOptions

Options that influence how the renderer will interact with the vertex shader.

blendDescription BlendDescription?

How the vertices will be blended with the output texture.

vertexRange VertexRange?

The set of vertices to use from the buffer.

vertexShader Guid?

The Guid of the vertex shader.

Remarks

The vertex shaders associated with the vertex buffer through the vertex shader Guid must have been loaded through the ID2D1EffectContext::LoadVertexShader method before this call is made.

If you pass the vertex option D2D1_VERTEX_OPTIONS_DO_NOT_CLEAR, then the method fails unless the blend description is exactly this:

BlendDescription blendDesc =  { D2D1_BLEND_ONE, D2D1_BLEND_ZERO, D2D1_BLEND_OPERATION_ADD, D2D1_BLEND_ONE, D2D1_BLEND_ZERO, D2D1_BLEND_OPERATION_ADD, { 1.0f, 1.0f, 1.0f, 1.0f } };

If this call fails, the corresponding Effect instance is placed into an error state and fails to draw.

If blendDescription is null, a foreground-over blend mode is used.

Operators

explicit operator DrawInformation(nint)

public static explicit operator DrawInformation(nint nativePtr)

Parameters

nativePtr nint

Returns

DrawInformation