Click or drag to resize
AB4D logo

DXSceneUseSharedWpfTexture Property

Gets or sets a nullable Boolean that is used only when using BackBuffer without SwapChain and specifies if DXScene is using a shared resources (texture) that can be used by both DirectX 11 (DXEngine) and DirectX 9 (WPF). Using shared resources improves performance because the texture that is used to render the DirectX 11 image is shader with WPF composition engine. This means that the texture is not copied to main CPU memory and than back to GPU by WPF. When the value is not set by the user (is null), then the value is set in the DXScene initialization. It is set to true when DXEngine is using the same graphics card (adapter) then WPF. Otherwise the value is set to false.

Namespace:  Ab3d.DirectX
Assembly:  Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 5.1.8147.1045
Syntax
C#
public Nullable<bool> UseSharedWpfTexture { get; set; }

Property Value

Type: NullableBoolean
Remarks

UseSharedWpfTexture gets or sets a nullable Boolean that is used only when using BackBuffer without SwapChain and specifies if DXScene is using a shared resources (texture) that can be used by both DirectX 11 (DXEngine) and DirectX 9 (WPF).

Using shared resources improves performance because the texture that is used to render the DirectX 11 image is shader with WPF composition engine. This means that the texture is not copied to main CPU memory and than back to GPU by WPF.

When the value is not set by the user (is null), then the value is set in the DXScene initialization. It is set to true when DXEngine is using the same graphics card (adapter) then WPF. Otherwise the value is set to false.

Examples

If you want to set the value of UseSharedWpfTexture to false, this needs to be done before the DirectX buffers and other resources are created. The best place to set the value is in the DXSceneDeviceCreated event handler.

MainDXViewportView.DXSceneDeviceCreated += delegate(object sender, EventArgs e)
{
    if (MainDXViewportView.DXScene != null) // DXScene can be null in case of WPF rendering
        MainDXViewportView.DXScene.UseSharedWpfTexture = false;
};
See Also