Click or drag to resize
AB4D logo

DXDevice Class

DXDevice is a DXEngine's wrapper for the DirectX device.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXDisposableDXResource
      Ab3d.DirectXDXDevice

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class DXDevice : DisposableDXResource

The DXDevice type exposes the following members.

Constructors
 NameDescription
Public methodDXDevice Constructor
Top
Properties
 NameDescription
Public propertyAdapter Gets an adapter (graphics card) that is used by the created Device. Adapter is null if the Device is not yet created.
Public propertyBackgroundThreadsManager Gets or sets a BackgroundThreadsManager that is used for background rendering in DXScene objects (if DXScene does not provide its onw instance of BackgroundThreadsManager).
Public propertyCommonStates CommonStates that store all common states
Public propertyConfiguration DXDeviceConfiguration configuration used for creation of DirectX Device and SwapChain.
Public propertyDevice Gets a DirectX device that is used by this DXDevice
Public propertyDeviceCapabilities DeviceCapabilities for this DirectX device
Public propertyDeviceDescription Gets device description that is retrieved from the Adapter.Description.Description.
Public propertyDeviceId Gets device id that is retrieved from the Adapter.Description.DeviceId.
Public propertyDXGIVersion Gets the DXGI version supported by the Device and operating system. The versions can be from 1.1 to 1.4.
Public propertyEffectsManager EffectsManager that stores all registered effects
Public propertyImmediateContext Gets a DirectX Immediate Device context
Public propertyImmediateContextStatesManager ContextStatesManager that is used for the immediate contex
Public propertyIsDebugDevice Gets a boolean that specifies if the created Device was created with Debug layer. Note that this property can be false even when the CreateDebugDirectXDevice is true. This indicates that the debug device cannot be created. This can be cased because debug layer is disabled in "DirectX Control panel" or the Debug layer is not installer on the system (it is usually installed with Visual Studio or with Windows SDK).
Public propertyIsMeasuringMeshUpdateStatistics Gets or set a Boolean that specifies if mesh updates are tracked during DXScene's Update phase. This value is automatically to true when IsCollectingStatistics is true. In this case the engine is setting MeshUpdatesCount and MeshBytesUploaded properties that are then set to RenderingStatistics object.
Public propertyIsRemoteDevice Gets a boolean that specifies if the device is a remote device (Adapter.Description1.Flags has Remote flag set).
Public propertyMeshBytesUploaded Gets the total uploaded bytes that were uploaded from CPU to GPU memory to update meshes. This value is automatically set by various parts of DXEngine when IsMeasuringMeshUpdateStatistics is true. This value is used to set the MeshBytesUploaded.
Public propertyMeshUpdatesCount Gets the number of mesh buffers that were updated during Update phase. This value is automatically set by various parts of DXEngine when IsMeasuringMeshUpdateStatistics is true. This value is used to set the MeshUpdatesCount.
Public propertyTextureCache TextureCache is used to cache the textures
Top
Methods
 NameDescription
Public methodCreateBlendState(BlendStateDescription) CreateBlendState returns a BlendState from BlendStateDescription.
Public methodCreateBlendState(BlendOption, BlendOption) CreateBlendState returns a BlendState from sourceBlend and destinationBlend and operation set to Add for RGB channels (alpha values blend are added together).
Public methodCreateConstantBuffer CreateConstantBuffer returns a Buffer that represents a constants buffer.
Public methodCreateDepthStencilBuffer CreateDepthStencilBuffer returns a Texture2D that represents a DepthStencilBuffer with the specified size, multisample description and format
Public methodCreateDepthStencilState CreateDepthStencilState returns a DepthStencilState
Public methodCreateDepthStencilView(Int32, Int32, SampleDescription, String) CreateDepthStencilView returns a DepthStencilView with the specified size and multisample description
Public methodCreateDepthStencilView(Int32, Int32, SampleDescription, Format, String) CreateDepthStencilView returns a DepthStencilView with the specified size, multisample description and format
Public methodStatic memberCreateDevice CreateDevice creates DirectX device with specified parameters. This method correctly handles device creation when featureLevels array contains Level_11_1 but that runtime is not installed on the system (for example on Windows 7 SP 1 without Platform Update). If device cannot be created an exception is thrown or null is returned.
Public methodCreateDXSceneWithBackBuffer(Int32, Int32, Int32, Int32, Single, Single, String) CreateDXSceneWithBackBuffer creates a DXScene that will be using BackBuffer (instead of SwapChain) to render its content to.
Public methodCreateDXSceneWithBackBuffer(Int32, Int32, Int32, Int32, Single, Single, Boolean, String) CreateDXSceneWithBackBuffer creates a DXScene that will be using BackBuffer (instead of SwapChain) to render its content to.
Public methodCreateDXSceneWithSwapChain CreateDXSceneWithSwapChain creates a DXScene that is using SwapChain to show its content.
Public methodCreateRasterizerState CreateRasterizerState returns a RasterizerState.
Public methodCreateSamplerState CreateSamplerState returns a SamplerState
Public methodCreateSwapChain(IntPtr, Int32, Int32, SampleDescription) CreateSwapChain returns a SwapChain for the specified window handle, size and multisample description.
Public methodCreateSwapChain(IntPtr, Int32, Int32, SampleDescription, SwapEffect) CreateSwapChain returns a SwapChain for the specified window handle, size and multisample description.
Public methodCreateTexture2D(Texture2DDescription) CreateTexture2D returns a buffer as Texture2D.
Public methodCreateTexture2D(Int32, Int32, SampleDescription, Boolean, Boolean, Boolean) CreateTexture2D returns a buffer as Texture2D with standard format (defined by StandardBufferFormat).
Public methodCreateTexture2D(Int32, Int32, SampleDescription, Boolean, Boolean, Boolean, Boolean, Format) CreateTexture2D returns a buffer as Texture2D.
Public methodCreateTexture2DDescription(Int32, Int32, SampleDescription, Boolean, Boolean, Boolean) CreateTexture2DDescription returns a Texture2DDescription that can be used to create a back buffer with standard format (defined by StandardBufferFormat).
Public methodCreateTexture2DDescription(Int32, Int32, SampleDescription, Boolean, Boolean, Boolean, Boolean, Format) CreateTexture2DDescription returns a Texture2DDescription that can be used to create a back buffer.
Public methodDisposeWithDXDevice DisposeWithDXDevice method adds the specified disposable object to the list of objects that will be disposed when this DXDevice will be disposed.
Public methodStatic memberGetAllSystemAdapters Returns all Adapter1 that are supported on the system.
Public methodGetUsedMultisamplingDescription GetUsedMultisamplingDescription returns a SampleDescription from specified multisampleCount
Public methodInitializeDevice InitializeDevice creates the DirectX device if it was not yet created.
Public methodIsAnyDXSceneRegistered Gets true if any DXScene is using this DXDevice. Else returns false.
Public methodIsUsingDefaultSystemAdapter Returns true if the default system adapter is used.
Top
Events
 NameDescription
Public eventBeforeDeviceDisposed Occurs just before the DirectX device will be disposed and after all other resources have been already disposed. Can be used to check for undisposed resources.
Top
Fields
 NameDescription
Public fieldStatic memberLogger Logger object is always null in release build.
Public fieldStatic memberMaxTextureDimension Max width or height of the texture in DirectX 11.
Public fieldStatic memberNoMultisamplingSampleDescription SampleDescription that is used to define no multisampling
Public fieldResourcesCache Gets or sets an IDisposable object that can be used for caching the resources created on this DXDevice. This property is used by DXViewportView to cache WpfMaterial, DXMeshGeometry3D and SceneNodes objects created from WPF objects. It is not recommended to set this property to any other value.
Public fieldStatic memberStandardBufferFormat Standard back buffer format (Default value B8G8R8A8_UNorm is required by WPF)
Public fieldStatic memberStandardDepthStencilFormat Standard format for DepthStencil buffer (D32_Float - 32 bit depth buffer, no stencil buffer)
Public fieldStatic memberStandardSwapEffect Gets or sets a SwapEffect that is used to create the SwapChain (if supported by the operating system and device). By default this value is set to FlipDiscard that is used if supported by OS. Otherwise FlipSequential is used and if this is not supported then Discard is used.
Top
See Also