Table of Contents

Class DX11RenderHostBase

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

Constructors

DX11RenderHostBase()

Initializes a new instance of the DX11RenderHostBase class.

public DX11RenderHostBase()

DX11RenderHostBase(Func<IDevice3DResources, IRenderer>)

Initializes a new instance of the DX11RenderHostBase class.

public DX11RenderHostBase(Func<IDevice3DResources, IRenderer> createRenderer)

Parameters

createRenderer Func<IDevice3DResources, IRenderer>

The create renderer.

Fields

UpdateRequested

The update requested

protected volatile bool UpdateRequested

Field Value

bool

renderContext

protected RenderContext? renderContext

Field Value

RenderContext

renderStatistics

protected readonly RenderStatistics renderStatistics

Field Value

RenderStatistics

renderer

protected IRenderer? renderer

Field Value

IRenderer

Properties

ActualHeight

Gets or sets the actual height.

public float ActualHeight { get; }

Property Value

float

The actual height.

ActualWidth

Gets or sets the actual width.

public float ActualWidth { get; }

Property Value

float

The actual width.

ClearColor

Gets or sets the color of the clear.

public Color4 ClearColor { get; set; }

Property Value

Color4

The color of the clear.

D2DTarget

Gets the d2d controls.

public D2DTargetProxy? D2DTarget { get; }

Property Value

D2DTargetProxy

The d2 d controls.

DepthStencilBufferView

Gets the depth stencil buffer view.

public DepthStencilView? DepthStencilBufferView { get; }

Property Value

DepthStencilView

The depth stencil buffer view.

Device

Gets the device.

public Device1? Device { get; }

Property Value

Device1

The device.

Device2D

Gets the device2d.

public Device? Device2D { get; }

Property Value

Device

The device2d.

DpiScale

Gets or sets the dpi scale.

public float DpiScale { get; set; }

Property Value

float

The dpi scale.

EffectsManager

Gets or sets the effects manager.

public IEffectsManager? EffectsManager { get; set; }

Property Value

IEffectsManager

The effects manager.

EnableParallelProcessing

Use separate thread to do non-rendering related tasks during render call.

public bool EnableParallelProcessing { get; set; }

Property Value

bool

EnableRenderFrustum

Gets or sets a value indicating whether [enable render frustum].

public bool EnableRenderFrustum { get; set; }

Property Value

bool

true if [enable render frustum]; otherwise, false.

EnableSharingModelMode

Gets or sets a value indicating whether [enable sharing model mode].

public bool EnableSharingModelMode { get; set; }

Property Value

bool

true if [enable sharing model mode]; otherwise, false.

FeatureLevel

Gets the feature level.

public FeatureLevel FeatureLevel { get; }

Property Value

FeatureLevel

The feature level.

GUID

Gets the unique identifier.

public Guid GUID { get; }

Property Value

Guid

The unique identifier.

ImmediateDeviceContext

Gets the immediate device context.

public DeviceContextProxy? ImmediateDeviceContext { get; }

Property Value

DeviceContextProxy

The immediate device context.

IsBusy

Gets or sets a value indicating whether this instance is busy.

public bool IsBusy { get; }

Property Value

bool

true if this instance is busy; otherwise, false.

IsDeferredLighting

Gets a value indicating whether this instance is deferred lighting.

public bool IsDeferredLighting { get; }

Property Value

bool

true if this instance is deferred lighting; otherwise, false.

IsInitialized

Gets or sets a value indicating whether this instance is initialized.

public bool IsInitialized { get; }

Property Value

bool

true if this instance is initialized; otherwise, false.

IsRendering

Gets or sets a value indicating whether this instance is rendering.

public bool IsRendering { get; set; }

Property Value

bool

true if this instance is rendering; otherwise, false.

IsShadowMapEnabled

Gets or sets a value indicating whether shadow map enabled.

public bool IsShadowMapEnabled { get; set; }

Property Value

bool

true if this instance is shadow map enabled; otherwise, false.

MSAA

Gets or sets the Multi-Sampling-Anti-Alias.

public MSAALevel MSAA { get; set; }

Property Value

MSAALevel

The msaa.

PerFrameFlattenedScene

Gets the current frame renderables for rendering.

public abstract FastList<KeyValuePair<int, SceneNode>> PerFrameFlattenedScene { get; }

Property Value

FastList<KeyValuePair<int, SceneNode>>

The per frame renderable.

PerFrameLights

Gets the per frame lights.

public abstract IEnumerable<LightNode?> PerFrameLights { get; }

Property Value

IEnumerable<LightNode>

The per frame lights.

PerFrameNodesWithPostEffect

Gets the post effects render cores for this frame

public abstract FastList<SceneNode> PerFrameNodesWithPostEffect { get; }

Property Value

FastList<SceneNode>

The post effects render cores.

PerFrameOpaqueNodes

Gets the per frame render cores.

public abstract FastList<SceneNode> PerFrameOpaqueNodes { get; }

Property Value

FastList<SceneNode>

The per frame render cores.

PerFrameOpaqueNodesInFrustum

Gets the per frame opaque nodes in frustum.

public abstract FastList<SceneNode> PerFrameOpaqueNodesInFrustum { get; }

Property Value

FastList<SceneNode>

The per frame opaque nodes in frustum.

PerFrameParticleNodes

Gets the per frame transparent nodes.

public abstract FastList<SceneNode> PerFrameParticleNodes { get; }

Property Value

FastList<SceneNode>

The per frame transparent nodes.

PerFrameTransparentNodes

Gets the per frame transparent nodes.

public abstract FastList<SceneNode> PerFrameTransparentNodes { get; }

Property Value

FastList<SceneNode>

The per frame transparent nodes.

PerFrameTransparentNodesInFrustum

Gets the per frame transparent node in frustum.

public abstract FastList<SceneNode> PerFrameTransparentNodesInFrustum { get; }

Property Value

FastList<SceneNode>

The per frame transparent node in frustum.

RenderBuffer

Gets the render buffer.

public DX11RenderBufferProxyBase? RenderBuffer { get; }

Property Value

DX11RenderBufferProxyBase

The render buffer.

RenderConfiguration

Gets or sets the render configuration.

public DX11RenderHostConfiguration RenderConfiguration { get; set; }

Property Value

DX11RenderHostConfiguration

The render configuration.

RenderContext

public RenderContext? RenderContext { get; }

Property Value

RenderContext

RenderContext2D

Gets the render context2d.

public RenderContext2D? RenderContext2D { get; }

Property Value

RenderContext2D

The render context2d.

RenderStatistics

Gets the render statistics.

public IRenderStatistics RenderStatistics { get; }

Property Value

IRenderStatistics

The render statistics.

RenderTargetBufferView

Gets the color buffer view.

public RenderTargetView? RenderTargetBufferView { get; }

Property Value

RenderTargetView

The color buffer view.

RenderTechnique

Gets or sets the render technique.

public IRenderTechnique? RenderTechnique { get; set; }

Property Value

IRenderTechnique

The render technique.

Renderer

The renderer

public IRenderer? Renderer { get; }

Property Value

IRenderer

SharedModelContainer

Gets or sets the shared model container.

public IModelContainer? SharedModelContainer { get; set; }

Property Value

IModelContainer

The shared model container.

ShowRenderDetail

Gets or sets a value indicating whether [show render statistics].

public RenderDetail ShowRenderDetail { get; set; }

Property Value

RenderDetail

true if [show render statistics]; otherwise, false.

Viewport

public IViewport3DX? Viewport { get; set; }

Property Value

IViewport3DX

Methods

AttachRenderable(IDeviceResources?)

Attaches the renderable.

protected virtual void AttachRenderable(IDeviceResources? deviceResources)

Parameters

deviceResources IDeviceResources

The device resources.

CanRender()

Determines whether this instance can render.

protected virtual bool CanRender()

Returns

bool

true if this instance can render; otherwise, false.

ClearRenderTarget(DeviceContextProxy, bool, bool)

Clears the render target.

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

Parameters

context DeviceContextProxy

The context.

clearBackBuffer bool

if set to true [clear back buffer].

clearDepthStencilBuffer bool

if set to true [clear depth stencil buffer].

CreateAndBindBuffers()

Creates the and bind buffers.

protected void CreateAndBindBuffers()

CreateRenderBuffer()

Creates the render buffer.

protected abstract DX11RenderBufferProxyBase? CreateRenderBuffer()

Returns

DX11RenderBufferProxyBase

CreateRenderContext()

Creates the render context.

protected virtual RenderContext CreateRenderContext()

Returns

RenderContext

CreateRenderContext2D(DeviceContext?)

Creates the render context2 d.

protected virtual RenderContext2D? CreateRenderContext2D(DeviceContext? context)

Parameters

context DeviceContext

The context.

Returns

RenderContext2D

DetachRenderable()

Detaches the renderable.

protected virtual void DetachRenderable()

DisposeBuffers()

Disposes the buffers.

protected virtual void DisposeBuffers()

EndD3D()

public void EndD3D()

Invalidate(InvalidateTypes)

Invalidate by InvalidateTypes

public void Invalidate(InvalidateTypes type)

Parameters

type InvalidateTypes

InvalidatePerFrameRenderables()

Invalidates the per frame renderables.

public void InvalidatePerFrameRenderables()

InvalidateRender()

Invalidates the render.

public void InvalidateRender()

InvalidateSceneGraph()

Invalidates the scene graph, request a complete scene graph traverse during next frame.

public void InvalidateSceneGraph()

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.

OnEndingD3D()

Called when [ending d3 d].

protected virtual void OnEndingD3D()

OnInitializeBuffers(DX11RenderBufferProxyBase, IRenderer?)

Called when [initialize buffers].

protected virtual void OnInitializeBuffers(DX11RenderBufferProxyBase buffer, IRenderer? renderer)

Parameters

buffer DX11RenderBufferProxyBase

The buffer.

renderer IRenderer

The renderer.

OnRender(TimeSpan)

Called when [render].

protected abstract void OnRender(TimeSpan time)

Parameters

time TimeSpan

The time.

OnRender2D(TimeSpan)

Called when [render2d].

protected abstract void OnRender2D(TimeSpan time)

Parameters

time TimeSpan

The time.

OnStartD3D()

protected virtual void OnStartD3D()

PostRender()

Called after OnRender.

protected abstract void PostRender()

PreRender(bool, bool)

Called before OnRender.

protected virtual void PreRender(bool invalidateSceneGraph, bool invalidatePerFrameRenderables)

Parameters

invalidateSceneGraph bool
invalidatePerFrameRenderables bool

ReinitializeEffectsManager()

public void ReinitializeEffectsManager()

Resize(int, int)

Resizes

public void Resize(int width, int height)

Parameters

width int

The width.

height int

The height.

Restart(bool)

Restarts the render host.

If HotRestart = true, only recreate buffers, otherwise dispose all resources and call StartD3D.

protected void Restart(bool hotRestart)

Parameters

hotRestart bool

if set to true [hotRestart].

SetDefaultRenderTargets(DeviceContextProxy?, bool)

Set default render target to specify context.

public bool SetDefaultRenderTargets(DeviceContextProxy? context, bool clear = true)

Parameters

context DeviceContextProxy
clear bool

Returns

bool

Set successful?

SetDefaultRenderTargets(bool)

Sets the default render targets.

public virtual void SetDefaultRenderTargets(bool clear)

Parameters

clear bool

if set to true [clear].

StartD3D(int, int)

public void StartD3D(int width, int height)

Parameters

width int
height int

StartRendering()

Starts the rendering.

public virtual void StartRendering()

StopRendering()

Stops the rendering.

public virtual void StopRendering()

TriggerSceneGraphUpdated()

protected void TriggerSceneGraphUpdated()

UpdateAndRender()

Updates the and render.

public bool UpdateAndRender()

Returns

bool

Events

EffectsManagerChanged

Occurs when effects manager is changed.

public event EventHandler<IEffectsManager>? EffectsManagerChanged

Event Type

EventHandler<IEffectsManager>

ExceptionOccurred

Occurs when [exception occurred].

public event EventHandler<RelayExceptionEventArgs>? ExceptionOccurred

Event Type

EventHandler<RelayExceptionEventArgs>

FrustumEnabledChanged

public event EventHandler<BoolArgs>? FrustumEnabledChanged

Event Type

EventHandler<BoolArgs>

OnNewRenderTargetTexture

Occurs when [on new render target texture].

public event EventHandler<Texture2DArgs>? OnNewRenderTargetTexture

Event Type

EventHandler<Texture2DArgs>

Rendered

Occurs when each render frame finished rendering.

public event EventHandler? Rendered

Event Type

EventHandler

SceneGraphUpdated

Occurs when [scene graph updated].

public event EventHandler? SceneGraphUpdated

Event Type

EventHandler

StartRenderLoop

Occurs when [start render loop].

public event EventHandler<EventArgs>? StartRenderLoop

Event Type

EventHandler<EventArgs>

StopRenderLoop

Occurs when [stop render loop].

public event EventHandler<EventArgs>? StopRenderLoop

Event Type

EventHandler<EventArgs>