bool IsLoaded { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The IsLoaded property of the Texture class indicates whether the texture has finished loading. This property is useful for checking the loading status of a texture, especially when dealing with asynchronous loading operations.

Usage

Use the IsLoaded property to determine if a texture is ready for use. This can be particularly important when you need to ensure that a texture is fully loaded before performing operations that depend on it, such as rendering or applying it to a material.

Example

// Example of checking if a texture is loaded
Texture myTexture = Texture.Load("path/to/texture");

if (myTexture.IsLoaded)
{
    // Proceed with operations that require the texture
    ApplyTextureToMaterial(myTexture);
}
else
{
    // Handle the case where the texture is not yet loaded
    Log.Warning("Texture is not loaded yet.");
}