Add support for loading images for use in ImGui windows

This commit is contained in:
meli 2020-01-23 13:45:40 -08:00
parent c95b39b6e8
commit cc676a25f5
3 changed files with 43 additions and 1 deletions

View file

@ -109,6 +109,32 @@ namespace Dalamud.Interface
this.presentHook.Dispose();
}
public TextureWrap LoadImage(string filePath)
{
try
{
return this.scene?.LoadImage(filePath) ?? null;
}
catch (Exception ex)
{
Log.Error(ex, $"Failed to load image from {filePath}");
}
return null;
}
public TextureWrap LoadImage(byte[] imageData)
{
try
{
return this.scene?.LoadImage(imageData) ?? null;
}
catch (Exception ex)
{
Log.Error(ex, "Failed to load image from memory");
}
return null;
}
private IntPtr PresentDetour(IntPtr swapChain, uint syncInterval, uint presentFlags)
{
if (this.scene == null)