TextureExtensions Class
Namespace: Stride.GraphicsAssembly: Stride.Graphics.dll
System.Object →
TextureExtensions
Derived from TextureExtensions:
public static class TextureExtensions
Name | Description | |
---|---|---|
Methods | ||
CreateDepthTextureCompatible(Texture) | Creates a new texture that can be used as a ShaderResource from an existing depth texture. |
|
EnsureRenderTarget(Texture) | ||
FromFileData(GraphicsDevice, Byte[]) | Creates a texture from an image file data (png, dds, ...). |
|
ToDepthStencilReadOnlyTexture(Texture) | Gets a view on this depth stencil texture as a readonly depth stencil texture. |
|
ToTextureView(Texture, ViewType, Int32, Int32) |
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
Type | Name | Description |
---|---|---|
Texture | texture |
Returns
Type | Description |
---|---|
Texture |
EnsureRenderTarget(Texture)
public static Texture EnsureRenderTarget(this Texture texture)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture |
Returns
Type | Description |
---|---|
Texture |
FromFileData(GraphicsDevice, Byte[])
Creates a texture from an image file data (png, dds, ...).
public static Texture FromFileData(GraphicsDevice graphicsDevice, byte[] data)
Parameters
Type | Name | Description |
---|---|---|
GraphicsDevice | graphicsDevice | The graphics device in which to create the texture |
System.Byte[] | data | The image file data |
Returns
Type | Description |
---|---|
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
Type | Name | Description |
---|---|---|
Texture | texture |
Returns
Type | Description |
---|---|
Texture | A new texture object that is bouded to the requested view. |
ToTextureView(Texture, ViewType, Int32, Int32)
public static Texture ToTextureView(this Texture texture, ViewType type, int arraySlice, int mipLevel)
Parameters
Type | Name | Description |
---|---|---|
Texture | texture | |
ViewType | type | |
System.Int32 | arraySlice | |
System.Int32 | mipLevel |
Returns
Type | Description |
---|---|
Texture |