|
TextureLoader Class |
TextureLoader static class contains a method that can load image file into ShaderResourceView.
In case the image file is png, jpg, tiff, gif, bmp or ico then WIC image decoder is used.
In case the image file is dds (DirectDraw Surface file format that is optimized for DirectX graphics), the internal DDS file loader is used.
Inheritance Hierarchy SystemObject
Ab3d.DirectXTextureLoader
Namespace: Ab3d.DirectXAssembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.1.9105.2048 (1.0.0.0)
Syntax public static class TextureLoader
The TextureLoader type exposes the following members.
Methods | Name | Description |
---|
| CreateOnePixelTexture |
CreateOnePixelTexture creates a 1 x 1 texture with the specified color (color is converted into BGRA byte values) and returns the texture as ShaderResourceView.
|
| CreateShaderResourceView(Device, Byte, Int32, Int32, Int32, Format, Boolean) |
CreateShaderResourceView returns a ShaderResourceView from the specified byte array. The method can also generate mipmaps when generateMipMaps is set to true (by default).
|
| CreateShaderResourceView(DXDevice, Byte, Int32, Int32, Int32, Format, Boolean) |
CreateShaderResourceView returns a ShaderResourceView from the specified byte array. The method can also generate mipmaps when generateMipMaps is set to true (by default).
|
| CreateShaderResourceView(Device, Byte, Int32, Int32, Int32, Format, Boolean, Boolean) |
CreateShaderResourceView returns a ShaderResourceView from the specified byte array. The method can also generate mipmaps when generateMipMaps is set to true (by default).
|
| CreateStandardTextureMaterial(DXDevice, String) |
CreateStandardTextureMaterial method can load image png, jpg, tiff, gif, bmp, ico or dds file and create a StandardMaterial.
The loaded texture is set to the DiffuseTextures property. The method also sets the TextureBlendState and HasTransparency properties.
The returned StandardMaterial and the ShaderResourceView that is set to the DiffuseTextures must be manually disposed by the user.
|
| CreateStandardTextureMaterial(DXDevice, String, Boolean, Boolean, Boolean) |
CreateStandardTextureMaterial method can load image png, jpg, tiff, gif, bmp, ico or dds file and create a StandardMaterial.
The loaded texture is set to the DiffuseTextures property. The method also sets the TextureBlendState and HasTransparency properties.
The returned StandardMaterial and the ShaderResourceView that is set to the DiffuseTextures must be manually disposed by the user.
|
| HasTransparentPixels |
HasTransparentPixels returns true when the loaded image contains transparent pixels (where alpha is less the 1); for fully opaque image false is returned.
|
| IsSupportedFile |
Returns true if the specified file name has a file extension that is supported with this TextureLoader.
|
| IsSupportedFileExtension |
Returns true if the specified file extension has a file extension that is supported with this TextureLoader.
File extension must start with leading period (for example ".png").
|
| LoadShaderResourceView(Device, String, TextureInfo) |
LoadShaderResourceViewFrom can load image png, jpg, tiff, gif, bmp, ico or dds file into ShaderResourceView.
When loadDdsIfPresent is set to true and file extension is not dds, then loader checks if there is a dds file with the same name but dds file extension present in the same folder as the specified fileName.
If dds file exist, it is loaded instead of the file specified with fileName. This can greatly improve load performance and memory usage.
|
| LoadShaderResourceView(Device, String, Boolean, Boolean, Boolean) |
LoadShaderResourceViewFrom can load image png, jpg, tiff, gif, bmp, ico or dds file into ShaderResourceView.
When loadDdsIfPresent is set to true and file extension is not dds, the loader checked if there is a dds file with the same name but dds file extension.
If dds file exist, it is loaded instead of the file specified with fileName. This can greatly improve load performance and memory usage.
|
| LoadShaderResourceView(Device, String, Boolean, Boolean, Boolean, TextureInfo) |
LoadShaderResourceViewFrom can load image png, jpg, tiff, gif, bmp, ico or dds file into ShaderResourceView.
When loadDdsIfPresent is set to true and file extension is not dds, then loader checks if there is a dds file with the same name but dds file extension present in the same folder as the specified fileName.
If dds file exist, it is loaded instead of the file specified with fileName. This can greatly improve load performance and memory usage.
|
TopFields See Also