Table of Contents

Class WindowRenderTarget

Namespace
SharpDX.Direct2D1
Assembly
SharpDX.Direct2D1.dll
[Guid("2cd90698-12e2-11dc-9fed-001143a055f9")]
public class WindowRenderTarget : RenderTarget
Inheritance
WindowRenderTarget
Inherited Members

Constructors

WindowRenderTarget(Factory, RenderTargetProperties, HwndRenderTargetProperties)

Creates an WindowRenderTarget, a render target that renders to a window.

public WindowRenderTarget(Factory factory, RenderTargetProperties renderTargetProperties, HwndRenderTargetProperties hwndProperties)

Parameters

factory Factory

an instance of Factory

renderTargetProperties RenderTargetProperties

The rendering mode, pixel format, remoting options, DPI information, and the minimum DirectX support required for hardware rendering. For information about supported pixel formats, see {{Supported Pixel Formats and Alpha Modes}}.

hwndProperties HwndRenderTargetProperties

The window handle, initial size (in pixels), and present options.

Remarks

When you create a render target and hardware acceleration is available, you allocate resources on the computer's GPU. By creating a render target once and retaining it as long as possible, you gain performance benefits. Your application should create render targets once and hold onto them for the life of the application or until the {{D2DERR_RECREATE_TARGET}} error is received. When you receive this error, you need to recreate the render target (and any resources it created).

WindowRenderTarget(nint)

public WindowRenderTarget(nint nativePtr)

Parameters

nativePtr nint

Properties

Hwnd

Returns the nint associated with this render target.

public nint Hwnd { get; }

Property Value

nint

Methods

CheckWindowState()

Indicates whether the nint associated with this render target is occluded.

public WindowState CheckWindowState()

Returns

WindowState

A value that indicates whether the nint associated with this render target is occluded.

Remarks

Note??If the window was occluded the last time that EndDraw was called, the next time that the render target calls CheckWindowState, it will return D2D1_WINDOW_STATE_OCCLUDED regardless of the current window state. If you want to use CheckWindowState to determine the current window state, you should call CheckWindowState after every EndDraw call and ignore its return value. This call will ensure that your next call to CheckWindowState state will return the actual window state.?

Resize(Size2)

Changes the size of the render target to the specified pixel size.

public void Resize(Size2 ixelSizeRef)

Parameters

ixelSizeRef Size2

No documentation.

Remarks

After this method is called, the contents of the render target's back-buffer are not defined, even if the D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS option was specified when the render target was created.

Operators

explicit operator WindowRenderTarget(nint)

public static explicit operator WindowRenderTarget(nint nativePtr)

Parameters

nativePtr nint

Returns

WindowRenderTarget