Table of Contents

Class DX11RenderBufferProxyBase

Namespace
HelixToolkit.SharpDX.Render
Assembly
HelixToolkit.SharpDX.dll
public abstract class DX11RenderBufferProxyBase : DisposeObject, IDisposable
Inheritance
DX11RenderBufferProxyBase
Implements
Derived
Inherited Members

Constructors

DX11RenderBufferProxyBase(IDeviceResources, bool)

Initializes a new instance of the DX11RenderBufferProxyBase class.

public DX11RenderBufferProxyBase(IDeviceResources deviceResource, bool useDepthStencilBuffer = true)

Parameters

deviceResource IDeviceResources

The device resources.

useDepthStencilBuffer bool

Fields

VSyncInterval

The vertical synchronize internal. Only valid under swapchain rendering mode. Default = 0

0: disable; 1: Sync with frame; More detail: Present(int, PresentFlags)

public int VSyncInterval

Field Value

int

d2dTarget

The D2D controls

protected D2DTargetProxy? d2dTarget

Field Value

D2DTargetProxy

Properties

BackBuffer

public ShaderResourceViewProxy? BackBuffer { get; }

Property Value

ShaderResourceViewProxy

ColorBuffer

public ShaderResourceViewProxy? ColorBuffer { get; }

Property Value

ShaderResourceViewProxy

ColorBufferSampleDesc

Gets or sets the sample description.

public SampleDescription ColorBufferSampleDesc { get; }

Property Value

SampleDescription

The sample description.

D2DTarget

Gets the d2 d controls.

public D2DTargetProxy? D2DTarget { get; }

Property Value

D2DTargetProxy

The d2 d controls.

DepthStencilBuffer

The depth stencil buffer

public ShaderResourceViewProxy? DepthStencilBuffer { get; }

Property Value

ShaderResourceViewProxy

DepthStencilBufferNoMSAA

The depth stencil buffer

public ShaderResourceViewProxy? DepthStencilBufferNoMSAA { get; }

Property Value

ShaderResourceViewProxy

Device

The currently used Direct3D Device

public Device1? Device { get; }

Property Value

Device1

Device2D

Gets the device2 d.

public Device? Device2D { get; }

Property Value

Device

The device2 d.

DeviceContext2D

Gets the device context2 d.

public DeviceContext? DeviceContext2D { get; }

Property Value

DeviceContext

The device context2 d.

DeviceContextPool

Gets the device context pool.

public IDeviceContextPool? DeviceContextPool { get; }

Property Value

IDeviceContextPool

The device context pool.

DeviceResources

Gets or sets the device resources.

protected IDeviceResources DeviceResources { get; }

Property Value

IDeviceResources

The device resources.

Format

Gets or sets the texture format.

public Format Format { get; set; }

Property Value

Format

The format.

FullResDepthStencilPool

public TexturePool? FullResDepthStencilPool { get; }

Property Value

TexturePool

FullResPPBuffer

public PingPongColorBuffers? FullResPPBuffer { get; }

Property Value

PingPongColorBuffers

FullResRenderTargetPool

public TexturePool? FullResRenderTargetPool { get; }

Property Value

TexturePool

HalfResDepthStencilPool

public TexturePool? HalfResDepthStencilPool { get; }

Property Value

TexturePool

HalfResRenderTargetPool

public TexturePool? HalfResRenderTargetPool { get; }

Property Value

TexturePool

HasMSAA

Whether render target/depth stencil buffer are MSAA buffers.

public bool HasMSAA { get; }

Property Value

bool

Initialized

Gets or sets a value indicating whether this is initialized.

public bool Initialized { get; }

Property Value

bool

true if initialized; otherwise, false.

MSAA

Set MSAA level. If set to Two/Four/Eight, the actual level is set to minimum between Maximum and Two/Four/Eight

public MSAALevel MSAA { get; }

Property Value

MSAALevel

QuarterResDepthStencilPool

public TexturePool? QuarterResDepthStencilPool { get; }

Property Value

TexturePool

QuarterResRenderTargetPool

public TexturePool? QuarterResRenderTargetPool { get; }

Property Value

TexturePool

TargetHeight

Gets or sets the height of the target.

public int TargetHeight { get; }

Property Value

int

The height of the target.

TargetWidth

Gets or sets the width of the target.

public int TargetWidth { get; }

Property Value

int

The width of the target.

UseDepthStencilBuffer

Gets or sets a value indicating whether [use depth stencil buffer].

public bool UseDepthStencilBuffer { get; }

Property Value

bool

true if [use depth stencil buffer]; otherwise, false.

Methods

BeginDraw()

Begins the draw.

public virtual bool BeginDraw()

Returns

bool

ClearRenderTarget(DeviceContextProxy, Color4)

Clears the render target.

public void ClearRenderTarget(DeviceContextProxy context, Color4 color)

Parameters

context DeviceContextProxy

The context.

color Color4

The color.

ClearRenderTarget(DeviceContextProxy, Color4, bool, bool)

Clears the buffers with the clear-color

public void ClearRenderTarget(DeviceContextProxy context, Color4 color, bool clearBackBuffer, bool clearDepthStencilBuffer)

Parameters

context DeviceContextProxy
color Color4
clearBackBuffer bool
clearDepthStencilBuffer bool

ClearRenderTargetBinding(DeviceContextProxy)

Clears the render target binding.

public void ClearRenderTargetBinding(DeviceContextProxy context)

Parameters

context DeviceContextProxy

The context.

DisposeBuffers()

Disposes the buffers.

protected virtual void DisposeBuffers()

EndDraw()

Ends the draw.

public virtual bool EndDraw()

Returns

bool

GetMSAASampleDescription()

protected virtual SampleDescription GetMSAASampleDescription()

Returns

SampleDescription

Initialize(int, int, MSAALevel)

Initializes.

public ShaderResourceViewProxy? Initialize(int width, int height, MSAALevel msaa)

Parameters

width int

The width.

height int

The height.

msaa MSAALevel

The msaa.

Returns

ShaderResourceViewProxy

OnCreateBackBuffer(int, int)

protected abstract ShaderResourceViewProxy? OnCreateBackBuffer(int width, int height)

Parameters

width int
height int

Returns

ShaderResourceViewProxy

OnCreateRenderTargetAndDepthBuffers(int, int, bool, out ShaderResourceViewProxy?, out ShaderResourceViewProxy?)

protected virtual void OnCreateRenderTargetAndDepthBuffers(int width, int height, bool createDepthStencilBuffer, out ShaderResourceViewProxy? colorBuffer, out ShaderResourceViewProxy? depthStencilBuffer)

Parameters

width int
height int
createDepthStencilBuffer bool
colorBuffer ShaderResourceViewProxy
depthStencilBuffer ShaderResourceViewProxy

OnDispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void OnDispose(bool disposeManagedResources)

Parameters

disposeManagedResources bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Present()

Presents this drawing..

public virtual bool Present()

Returns

bool

RaiseOnDeviceLost()

Raises the on device lost.

protected void RaiseOnDeviceLost()

Resize(int, int)

Resize render target and depthbuffer resolution

public virtual ShaderResourceViewProxy? Resize(int width, int height)

Parameters

width int
height int

Returns

ShaderResourceViewProxy

SetDefaultRenderTargets(DeviceContextProxy, bool)

Sets the default render-targets

public void SetDefaultRenderTargets(DeviceContextProxy context, bool isColorBuffer = true)

Parameters

context DeviceContextProxy
isColorBuffer bool

Events

DeviceLost

Occurs when [on device lost].

public event EventHandler<EventArgs>? DeviceLost

Event Type

EventHandler<EventArgs>

OnNewBufferCreated

Occurs when [on new buffer created].

public event EventHandler<Texture2DArgs>? OnNewBufferCreated

Event Type

EventHandler<Texture2DArgs>