Class DX11Texture
Represent a DirectX Texture.
Inherited Members
Namespace: Evergine.DirectX11
Assembly: Evergine.DirectX11.dll
Syntax
public class DX11Texture : Texture, ILoadable, IDisposable, IDependencyObject
  Constructors
DX11Texture(DX11GraphicsContext, DataBox[], ref TextureDescription, ref SamplerStateDescription)
Initializes a new instance of the DX11Texture class.
Declaration
public DX11Texture(DX11GraphicsContext context, DataBox[] data, ref TextureDescription description, ref SamplerStateDescription samplerState)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DX11GraphicsContext | context | The graphics context.  | 
      
| DataBox[] | data | The data pointer.  | 
      
| TextureDescription | description | The texture description.  | 
      
| SamplerStateDescription | samplerState | the sampler state description for this texture.  | 
      
Fields
NativeTexture
The DirectX texture instance.
Declaration
public ID3D11Resource NativeTexture
  Field Value
| Type | Description | 
|---|---|
| ID3D11Resource | 
Properties
Name
Gets or sets a string identifying this instance. Can be used in graphics debuggers tools.
Declaration
public override string Name { get; set; }
  Property Value
| Type | Description | 
|---|---|
| string | 
Overrides
NativePointer
Gets the native pointer.
Declaration
public override IntPtr NativePointer { get; }
  Property Value
| Type | Description | 
|---|---|
| IntPtr | 
Overrides
ShaderResourceView
Gets the shader resource view.
Declaration
public ID3D11ShaderResourceView ShaderResourceView { get; }
  Property Value
| Type | Description | 
|---|---|
| ID3D11ShaderResourceView | 
UnorderedAccessView
Gets the unordered view.
Declaration
public ID3D11UnorderedAccessView UnorderedAccessView { get; }
  Property Value
| Type | Description | 
|---|---|
| ID3D11UnorderedAccessView | 
Methods
CopyTo(ID3D11DeviceContext, uint, uint, uint, uint, uint, Texture, uint, uint, uint, uint, uint, uint, uint, uint, uint)
Copy a pixel region from source to destination texture.
Declaration
public void CopyTo(ID3D11DeviceContext deviceContext, uint sourceX, uint sourceY, uint sourceZ, uint sourceMipLevel, uint sourceBaseArray, Texture destination, uint destinationX, uint destinationY, uint destinationZ, uint destinationMipLevel, uint destinationBasedArray, uint width, uint height, uint depth, uint layerCount)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ID3D11DeviceContext | deviceContext | Graphics Context.  | 
      
| uint | sourceX | U coord source texture.  | 
      
| uint | sourceY | V coord source texture.  | 
      
| uint | sourceZ | W coord source texture.  | 
      
| uint | sourceMipLevel | Source mip level.  | 
      
| uint | sourceBaseArray | Source array index.  | 
      
| Texture | destination | Destination texture.  | 
      
| uint | destinationX | U coord destination texture.  | 
      
| uint | destinationY | V coord destination texture.  | 
      
| uint | destinationZ | W coord destination texture.  | 
      
| uint | destinationMipLevel | Destination mip level.  | 
      
| uint | destinationBasedArray | Destination array index.  | 
      
| uint | width | Destination width.  | 
      
| uint | height | Destination height.  | 
      
| uint | depth | Destination depth.  | 
      
| uint | layerCount | Destination layer count.  | 
      
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public override void Dispose()
  Overrides
FromDirectXTexture(DX11GraphicsContext, IntPtr, TextureDescription?)
Generate a DXTexture from DirectX Texture2D pointer.
Declaration
public static DX11Texture FromDirectXTexture(DX11GraphicsContext context, IntPtr texturePointer, TextureDescription? textureDescription = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DX11GraphicsContext | context | DX context.  | 
      
| IntPtr | texturePointer | DirectX Texture pointer.  | 
      
| TextureDescription? | textureDescription | Overrided pixel format. This only affect to the generated TextureDescription. IT does not change the source texture format.  | 
      
Returns
| Type | Description | 
|---|---|
| DX11Texture | DXTexture with SharpDXTexture as resource.  | 
      
FromDirectXTexture(DX11GraphicsContext, ID3D11Texture2D, TextureDescription?)
Generate a DXTexture from Vortice Texture2D.
Declaration
public static DX11Texture FromDirectXTexture(DX11GraphicsContext context, ID3D11Texture2D vorticeTexture, TextureDescription? textureDescription = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| DX11GraphicsContext | context | DX context.  | 
      
| ID3D11Texture2D | vorticeTexture | SharpDXTexture instance.  | 
      
| TextureDescription? | textureDescription | The texture description.  | 
      
Returns
| Type | Description | 
|---|---|
| DX11Texture | DXTexture with SharpDXTexture as resource.  | 
      
GetDepthStencilView(uint, uint, uint)
Create a new DepthStencil view for this texture.
Declaration
public ID3D11DepthStencilView GetDepthStencilView(uint firstSlice, uint sliceCount, uint mipSlice)
  Parameters
| Type | Name | Description | 
|---|---|---|
| uint | firstSlice | The start slice of the view range.  | 
      
| uint | sliceCount | The number of slices in the view range.  | 
      
| uint | mipSlice | The mipmap level in the view range.  | 
      
Returns
| Type | Description | 
|---|---|
| ID3D11DepthStencilView | A new DepthStencil view.  | 
      
GetRenderTargetView(uint, uint, uint)
Create a new rendertargetview for this texture.
Declaration
public ID3D11RenderTargetView GetRenderTargetView(uint firstSlice, uint sliceCount, uint mipSlice)
  Parameters
| Type | Name | Description | 
|---|---|---|
| uint | firstSlice | The start slice of the view range.  | 
      
| uint | sliceCount | The number of slices in the view range.  | 
      
| uint | mipSlice | The mipmap level in the view range.  | 
      
Returns
| Type | Description | 
|---|---|
| ID3D11RenderTargetView | A new RenderTargetView instance.  | 
      
GetShaderResourceView(uint, uint, uint)
Create a new ShaderResource view for this texture.
Declaration
public ID3D11ShaderResourceView GetShaderResourceView(uint firstSlice, uint sliceCount, uint mipSlice)
  Parameters
| Type | Name | Description | 
|---|---|---|
| uint | firstSlice | The start slice of the view range.  | 
      
| uint | sliceCount | The number of slices in the view range.  | 
      
| uint | mipSlice | The mipmap level in the view range.  | 
      
Returns
| Type | Description | 
|---|---|
| ID3D11ShaderResourceView | A new ShaderResource view.  | 
      
GetUnorderedAccessView(uint, uint)
Create a new UnorderedAccessView for this texture.
Declaration
public ID3D11UnorderedAccessView GetUnorderedAccessView(uint arraySlice, uint mipSlice)
  Parameters
| Type | Name | Description | 
|---|---|---|
| uint | arraySlice | The slice in the view range.  | 
      
| uint | mipSlice | The mipmap level in the view range.  | 
      
Returns
| Type | Description | 
|---|---|
| ID3D11UnorderedAccessView | A new UnorderedAccessView.  | 
      
SetData(ID3D11DeviceContext, IntPtr, uint, uint)
Fill the buffer from a pointer.
Declaration
public void SetData(ID3D11DeviceContext deviceContext, IntPtr source, uint sourceSizeInBytes, uint subResource = 0)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ID3D11DeviceContext | deviceContext | Device Context.  | 
      
| IntPtr | source | The data pointer.  | 
      
| uint | sourceSizeInBytes | The size in bytes.  | 
      
| uint | subResource | The subresource index.  | 
      
ToStaging()
Return a new Buffer with ResourceUsage set to staging.
Declaration
public DX11Texture ToStaging()
  Returns
| Type | Description | 
|---|---|
| DX11Texture | New staging Buffer.  |