Table of Contents

Class CommandList

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll
[Guid("b4f34a19-2383-4d76-94f6-ec343657c3dc")]
public class CommandList : Image
Inheritance
CommandList
Inherited Members

Constructors

CommandList(DeviceContext)

Initializes a new instance of the CommandList class.

public CommandList(DeviceContext deviceContext)

Parameters

deviceContext DeviceContext

The device context.

CommandList(nint)

public CommandList(nint nativePtr)

Parameters

nativePtr nint

Methods

Close()

Instructs the command list to stop accepting commands so that you can use it as an input to an effect or in a call to ID2D1DeviceContext::DrawImage. You should call the method after it has been attached to an DeviceContext and written to but before the command list is used.

public void Close()

Remarks

This method returns if it has already been called on the command list. If an error occurred on the device context during population, the method returns that error. Otherwise, the method returns SharpDX.Result.Ok.

If the Close method returns an error, any future use of the command list results in the same error.

Stream(CommandSink)

Streams the contents of the command list to the specified command sink.

public void Stream(CommandSink sink)

Parameters

sink CommandSink

The sink into which the command list will be streamed.

Remarks

The command sink can be implemented by any caller of the API.

If the caller makes any design-time failure calls while a command list is selected as a target, the command list is placed in an error state. The stream call fails without making any calls to the passed in sink.

Sample use:

Class MyCommandSink : public CommandSink
{
public: // All of the CommandSink methods implemented here.
}; SharpDX.Result
StreamToMyCommandSink( __in CommandList *pCommandList  )
{ SharpDX.Result hr = SharpDX.Result.Ok; MyCommandSink *pCommandSink = new MyCommandSink(); hr = pCommandSink ? SharpDX.Result.Ok : E_OUTOFMEMORY; if (SUCCEEDED(hr)) { // Receive the contents of the command sink streamed to the sink. hr = pCommandList->Stream(pCommandSink); } SafeRelease(&pCommandSink); return hr; }

Operators

explicit operator CommandList(nint)

public static explicit operator CommandList(nint nativePtr)

Parameters

nativePtr nint

Returns

CommandList