 |
TextureLoaderCreateTexture(String, VulkanDevice, ActionGpuImage, IBitmapIO, Boolean, Boolean, ActionException, BitmapLoadOptions) Method |
CreateTexture loads the specified texture file in the background and calls the specified textureCreatedCallback when the GpuImage is created.
Optionally the textureCreationFailedCallback can be called when an exception happens.
See remarks for
TextureLoader for more info.
Namespace: Ab4d.SharpEngine.UtilitiesAssembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 4.0.9584+ba1aaa26d4181dd3fa8ed7b6398391d1affa36c8
Syntaxpublic static void CreateTexture(
string fileName,
VulkanDevice gpuDevice,
Action<GpuImage> textureCreatedCallback,
IBitmapIO? bitmapIO = null,
bool generateMipMaps = true,
bool useGpuDeviceCache = false,
Action<Exception>? textureCreationFailedCallback = null,
BitmapLoadOptions? bitmapLoadOptions = null
)
Parameters
- fileName String
- file name
- gpuDevice VulkanDevice
- VulkanDevice
- textureCreatedCallback ActionGpuImage
- Action with GpuImage as parameter that is called when the GpuImage is created
- bitmapIO IBitmapIO (Optional)
- Optional IBitmapIO that is used to load the texture. When null, then the DefaultBitmapIOis used
- generateMipMaps Boolean (Optional)
- when true (by default) then mip maps will be created for the GpuImage. This takes longer to create the GpuImage but improves the rendering performance and quality of shown texture.
- useGpuDeviceCache Boolean (Optional)
- when true (false by default) than before loading the image the GpuDevice's cache is checked if this file was already loaded. Also, the created GpuImage is cached by the GpuDevice's cache
- textureCreationFailedCallback ActionException (Optional)
- Optional Action with Exception as parameter that is called when an exception happens when loading the texture
- bitmapLoadOptions BitmapLoadOptions (Optional)
- optional structure with options to pass to image loader, for example, with setting PremultiplyAlpha it is possible to prevent alpha pre-multiplying the bitmap.
Return Value
created GpuImage
See Also