Class GraphicsMarshal
An unsafe class that provides a set of methods to access the underlying native DXGI and Direct3D devices and resources from its Stride counterparts.
public static class GraphicsMarshal
- Inheritance
-
objectGraphicsMarshal
Methods
CreateTextureFromNative(GraphicsDevice, ID3D11Texture2D*, bool, bool)
Creates a Texture from a Direct3D 11 texture.
public static Texture CreateTextureFromNative(GraphicsDevice device, ID3D11Texture2D* dxTexture2D, bool takeOwnership, bool isSRgb = false)
Parameters
deviceGraphicsDeviceThe GraphicsDevice in use.
dxTexture2DID3D11Texture2D*The Direct3D 11 texture.
takeOwnershipboolfalse to call Silk.NET.Direct3D11.ID3D11Resource.AddRef() on the texture; true to not call it, effectively taking ownership of the texture.
isSRgbboolA value indicating whether to set the format of the Texture to sRGB.
Returns
GetNativeDevice(GraphicsDevice)
Gets the underlying Direct3D 11 native device.
public static ComPtr<ID3D11Device> GetNativeDevice(GraphicsDevice device)
Parameters
deviceGraphicsDeviceThe Stride Graphics Device.
Returns
- ComPtr<ID3D11Device>
A COM pointer to a Silk.NET.Direct3D11.ID3D11Device instance representing the native Direct3D 11 device.
GetNativeDeviceContext(GraphicsDevice)
Gets the underlying Direct3D 11 native device context.
public static ComPtr<ID3D11DeviceContext> GetNativeDeviceContext(GraphicsDevice device)
Parameters
deviceGraphicsDeviceThe Stride Graphics Device.
Returns
- ComPtr<ID3D11DeviceContext>
A COM pointer to a Silk.NET.Direct3D11.ID3D11DeviceContext instance representing the native Direct3D 11 command queue.
GetNativeRenderTargetView(Texture)
Gets the underlying Direct3D 11 native render target view.
public static ComPtr<ID3D11RenderTargetView> GetNativeRenderTargetView(Texture texture)
Parameters
textureTexture
Returns
- ComPtr<ID3D11RenderTargetView>
A COM pointer to a Silk.NET.Direct3D11.ID3D11RenderTargetView instance representing the native Direct3D 11 render target view on the Texture.
GetNativeResource(GraphicsResource)
Gets the underlying Direct3D 11 native resource.
public static ComPtr<ID3D11Resource> GetNativeResource(GraphicsResource resource)
Parameters
resourceGraphicsResourceThe Stride Graphics Resource.
Returns
- ComPtr<ID3D11Resource>
A COM pointer to a Silk.NET.Direct3D11.ID3D11Resource instance representing the native Direct3D 11 resource.
GetNativeShaderResourceView(GraphicsResource)
Gets the underlying Direct3D 11 native shader resource view.
public static ComPtr<ID3D11ShaderResourceView> GetNativeShaderResourceView(GraphicsResource resource)
Parameters
resourceGraphicsResourceThe Stride Graphics Resource.
Returns
- ComPtr<ID3D11ShaderResourceView>
A COM pointer to a Silk.NET.Direct3D11.ID3D11ShaderResourceView instance representing the native Direct3D 11 shader resource view on the resource.
GetNativeSwapChain(GraphicsPresenter)
Gets the underlying DXGI swap-chain.
public static ComPtr<IDXGISwapChain1>? GetNativeSwapChain(GraphicsPresenter presenter)
Parameters
presenterGraphicsPresenterThe Stride Graphics Presenter.
Returns
- ComPtr<IDXGISwapChain1>?
A COM pointer to a Silk.NET.DXGI.IDXGISwapChain instance representing the native DirectX swap-chain, or null if the
presenterdoes not encapsulate a DXGI swap-chain.