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
createRendererFunc<IDevice3DResources, IRenderer>The create renderer.
Fields
UpdateRequested
The update requested
protected volatile bool UpdateRequested
Field Value
renderContext
protected RenderContext? renderContext
Field Value
renderStatistics
protected readonly RenderStatistics renderStatistics
Field Value
renderer
protected IRenderer? renderer
Field Value
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
EnableRenderFrustum
Gets or sets a value indicating whether [enable render frustum].
public bool EnableRenderFrustum { get; set; }
Property Value
- bool
trueif [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
trueif [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
trueif this instance is busy; otherwise,false.
IsDeferredLighting
Gets a value indicating whether this instance is deferred lighting.
public bool IsDeferredLighting { get; }
Property Value
- bool
trueif 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
trueif 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
trueif 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
trueif 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
PerFrameOpaqueNodes
Gets the per frame render cores.
public abstract FastList<SceneNode> PerFrameOpaqueNodes { get; }
Property Value
PerFrameOpaqueNodesInFrustum
Gets the per frame opaque nodes in frustum.
public abstract FastList<SceneNode> PerFrameOpaqueNodesInFrustum { get; }
Property Value
PerFrameParticleNodes
Gets the per frame transparent nodes.
public abstract FastList<SceneNode> PerFrameParticleNodes { get; }
Property Value
PerFrameTransparentNodes
Gets the per frame transparent nodes.
public abstract FastList<SceneNode> PerFrameTransparentNodes { get; }
Property Value
PerFrameTransparentNodesInFrustum
Gets the per frame transparent node in frustum.
public abstract FastList<SceneNode> PerFrameTransparentNodesInFrustum { get; }
Property Value
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
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
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
trueif [show render statistics]; otherwise,false.
Viewport
public IViewport3DX? Viewport { get; set; }
Property Value
Methods
AttachRenderable(IDeviceResources?)
Attaches the renderable.
protected virtual void AttachRenderable(IDeviceResources? deviceResources)
Parameters
deviceResourcesIDeviceResourcesThe device resources.
CanRender()
Determines whether this instance can render.
protected virtual bool CanRender()
Returns
- bool
trueif this instance can render; otherwise,false.
ClearRenderTarget(DeviceContextProxy, bool, bool)
Clears the render target.
public void ClearRenderTarget(DeviceContextProxy context, bool clearBackBuffer, bool clearDepthStencilBuffer)
Parameters
contextDeviceContextProxyThe context.
clearBackBufferboolif set to
true[clear back buffer].clearDepthStencilBufferboolif 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
CreateRenderContext()
Creates the render context.
protected virtual RenderContext CreateRenderContext()
Returns
CreateRenderContext2D(DeviceContext?)
Creates the render context2 d.
protected virtual RenderContext2D? CreateRenderContext2D(DeviceContext? context)
Parameters
contextDeviceContextThe context.
Returns
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
typeInvalidateTypes
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
disposeManagedResourcesbooltrueto release both managed and unmanaged resources;falseto 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
bufferDX11RenderBufferProxyBaseThe buffer.
rendererIRendererThe renderer.
OnRender(TimeSpan)
Called when [render].
protected abstract void OnRender(TimeSpan time)
Parameters
timeTimeSpanThe time.
OnRender2D(TimeSpan)
Called when [render2d].
protected abstract void OnRender2D(TimeSpan time)
Parameters
timeTimeSpanThe 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
ReinitializeEffectsManager()
public void ReinitializeEffectsManager()
Resize(int, int)
Resizes
public void Resize(int width, int height)
Parameters
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
hotRestartboolif set to
true[hotRestart].
SetDefaultRenderTargets(DeviceContextProxy?, bool)
Set default render target to specify context.
public bool SetDefaultRenderTargets(DeviceContextProxy? context, bool clear = true)
Parameters
contextDeviceContextProxyclearbool
Returns
- bool
Set successful?
SetDefaultRenderTargets(bool)
Sets the default render targets.
public virtual void SetDefaultRenderTargets(bool clear)
Parameters
clearboolif set to
true[clear].
StartD3D(int, int)
public void StartD3D(int width, int height)
Parameters
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
Events
EffectsManagerChanged
Occurs when effects manager is changed.
public event EventHandler<IEffectsManager>? EffectsManagerChanged
Event Type
ExceptionOccurred
Occurs when [exception occurred].
public event EventHandler<RelayExceptionEventArgs>? ExceptionOccurred
Event Type
FrustumEnabledChanged
public event EventHandler<BoolArgs>? FrustumEnabledChanged
Event Type
OnNewRenderTargetTexture
Occurs when [on new render target texture].
public event EventHandler<Texture2DArgs>? OnNewRenderTargetTexture
Event Type
Rendered
Occurs when each render frame finished rendering.
public event EventHandler? Rendered
Event Type
SceneGraphUpdated
Occurs when [scene graph updated].
public event EventHandler? SceneGraphUpdated
Event Type
StartRenderLoop
Occurs when [start render loop].
public event EventHandler<EventArgs>? StartRenderLoop
Event Type
StopRenderLoop
Occurs when [stop render loop].
public event EventHandler<EventArgs>? StopRenderLoop