Skip to content

Commit

Permalink
fix: create instance of TextureManager in Context
Browse files Browse the repository at this point in the history
  • Loading branch information
Rofli Sanches committed May 15, 2021
1 parent 0aebb50 commit 18e6614
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Source/Utils/UImGuiUtility.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ImGuiNET;
using System;

namespace UImGui
{
Expand All @@ -11,7 +12,7 @@ internal static Context CreateContext()
return new Context
{
Value = ImGui.CreateContext(),
TextureManager = default
TextureManager = new Texture.TextureManager()
};
}

Expand All @@ -23,7 +24,7 @@ internal static void DestroyContext(Context context)
internal static void SetCurrentContext(Context context)
{
Context = context;
ImGui.SetCurrentContext(context.Value);
ImGui.SetCurrentContext(context?.Value ?? IntPtr.Zero);
}
}
}

0 comments on commit 18e6614

Please sign in to comment.