Loading arbitrary images/textures + game textures for displaying with ImGui.
The API looks as follows:
var texture = Renderer.LoadTexture("path/to/texture.png", out var w, out var h);
if (texture == TextureHandle.Invalid)
{
Log.Error("Failed to load texture"); // Check console for more error messages
}
// ...
ImGui.Image(texture, w, h);
The procedure for game textures is similar:
var texture = ResourceManager.GetResource<Texture>(@"em\em001\00\mod\em001_00_BML", MtDti.Find("rTexture")!);
if (texture is null)
{
Log.Error("Failed to load texture");
return;
}
var texHandle = texture.GetTextureHandle();
if (texture == TextureHandle.Invalid)
{
Log.Error("Failed to obtain texture handle"); // Check console for more error messages
}
// ...
ImGui.Image(texHandle, texture.Width, texture.Height);
Loading arbitrary images/textures + game textures for displaying with ImGui.
The API looks as follows:
The procedure for game textures is similar:
Currently supported formats are:
ResourceManager
)