|
|
@ -29,10 +29,7 @@ public partial class ImGuiManager |
|
|
|
[DependsOn<Pipeline.OnStore>] |
|
|
|
[DependsOn<Pipeline.OnStore>] |
|
|
|
public struct ImGuiRenderPhase { } |
|
|
|
public struct ImGuiRenderPhase { } |
|
|
|
|
|
|
|
|
|
|
|
// Start out disabled, because we first need to set it with a valid instance. |
|
|
|
[Singleton] |
|
|
|
// TODO: Add a hint when a Singleton class is used without adding Disabled. |
|
|
|
|
|
|
|
// TODO: Add a [Disabled] attribute as shortcut? |
|
|
|
|
|
|
|
[Singleton, Add<Core.Disabled>] |
|
|
|
|
|
|
|
public class ImGuiData |
|
|
|
public class ImGuiData |
|
|
|
{ |
|
|
|
{ |
|
|
|
public ImGuiController Controller { get; } |
|
|
|
public ImGuiController Controller { get; } |
|
|
@ -91,7 +88,7 @@ public partial class ImGuiManager |
|
|
|
[DependsOn<Pipeline.OnLoad>] |
|
|
|
[DependsOn<Pipeline.OnLoad>] |
|
|
|
public static unsafe void Initialize<T>(World<T> world, GameWindow window, Canvas canvas, |
|
|
|
public static unsafe void Initialize<T>(World<T> world, GameWindow window, Canvas canvas, |
|
|
|
[Source<Input>] InputContext inputContext, Not<ImGuiData> _) |
|
|
|
[Source<Input>] InputContext inputContext, Not<ImGuiData> _) |
|
|
|
=> world.Entity<ImGuiData>().Enable().Set(new ImGuiData( |
|
|
|
=> world.Entity<ImGuiData>().Set(new ImGuiData( |
|
|
|
new(canvas.GL, window.Handle, inputContext.Value, () => { |
|
|
|
new(canvas.GL, window.Handle, inputContext.Value, () => { |
|
|
|
var io = ImGui.GetIO(); |
|
|
|
var io = ImGui.GetIO(); |
|
|
|
var style = ImGui.GetStyle(); |
|
|
|
var style = ImGui.GetStyle(); |
|
|
|