mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-22 08:29:18 +01:00
Add support for loading images for use in ImGui windows
This commit is contained in:
parent
c95b39b6e8
commit
cc676a25f5
3 changed files with 43 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue