Class TextureExtensions
public static class TextureExtensions
- Inheritance
-
TextureExtensions
Methods
CreateDepthTextureCompatible(Texture)
Creates a new texture that can be used as a ShaderResource from an existing depth texture.
public static Texture CreateDepthTextureCompatible(this Texture texture)
Parameters
texture
Texture
Returns
EnsureRenderTarget(Texture)
public static Texture EnsureRenderTarget(this Texture texture)
Parameters
texture
Texture
Returns
FromFileData(GraphicsDevice, byte[])
Creates a texture from an image file data (png, dds, ...).
public static Texture FromFileData(GraphicsDevice graphicsDevice, byte[] data)
Parameters
graphicsDevice
GraphicsDeviceThe graphics device in which to create the texture
data
byte[]The image file data
Returns
- Texture
The texture
ToDepthStencilReadOnlyTexture(Texture)
Gets a view on this depth stencil texture as a readonly depth stencil texture.
public static Texture ToDepthStencilReadOnlyTexture(this Texture texture)
Parameters
texture
Texture
Returns
- Texture
A new texture object that is bouded to the requested view.
ToTextureView(Texture, ViewType, int, int)
public static Texture ToTextureView(this Texture texture, ViewType type, int arraySlice, int mipLevel)