-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f973f9
commit 358cf91
Showing
9 changed files
with
158 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,119 @@ | ||
namespace Hypercube.ImGui; | ||
using Hypercube.Mathematics.Vectors; | ||
using ImGuiNET; | ||
using JetBrains.Annotations; | ||
|
||
namespace Hypercube.ImGui; | ||
|
||
[PublicAPI] | ||
public interface IImGui | ||
{ | ||
void Begin(string name); | ||
void Text(string label); | ||
bool Button(string label); | ||
void End(); | ||
|
||
void DockSpaceOverViewport(); | ||
void ShowDemoWindow(); | ||
void ShowDebugInput(); | ||
{ | ||
public void Dummy(Vector2 size) | ||
{ | ||
ImGuiNET.ImGui.Dummy(size); | ||
} | ||
|
||
public bool ArrowButton(string label, ImGuiDirection direction) | ||
{ | ||
return ImGuiNET.ImGui.ArrowButton(label, (ImGuiDir) direction); | ||
} | ||
|
||
public bool CheckboxFlags(string label, ref int flags, int value) | ||
{ | ||
return ImGuiNET.ImGui.CheckboxFlags(label, ref flags, value); | ||
} | ||
|
||
public void Text(string label) | ||
{ | ||
ImGuiNET.ImGui.Text(label); | ||
} | ||
|
||
public bool Button(string label) | ||
{ | ||
return ImGuiNET.ImGui.Button(label); | ||
} | ||
|
||
public void Begin(string name) | ||
{ | ||
ImGuiNET.ImGui.Begin(name); | ||
} | ||
|
||
public bool Checkbox(string label, ref bool value) | ||
{ | ||
return ImGuiNET.ImGui.Checkbox(label, ref value); | ||
} | ||
|
||
public void Bullet() | ||
{ | ||
ImGuiNET.ImGui.Bullet(); | ||
} | ||
|
||
public void Columns() | ||
{ | ||
ImGuiNET.ImGui.Columns(); | ||
} | ||
|
||
public void Columns(int count) | ||
{ | ||
ImGuiNET.ImGui.Columns(count); | ||
} | ||
|
||
public void Columns(int count, string id) | ||
{ | ||
ImGuiNET.ImGui.Columns(count, id); | ||
} | ||
|
||
public void Columns(int count, string id, bool border) | ||
{ | ||
ImGuiNET.ImGui.Columns(count, id, border); | ||
} | ||
|
||
public void Combo(string label, ref int item, string separatedItems) | ||
{ | ||
ImGuiNET.ImGui.Combo(label, ref item, separatedItems); | ||
} | ||
|
||
public void Image(nint texture, Vector2 size) | ||
{ | ||
ImGuiNET.ImGui.Image(texture, size); | ||
} | ||
|
||
public void Image(nint texture, Vector2 size, Vector2 uv) | ||
{ | ||
ImGuiNET.ImGui.Image(texture, size, uv); | ||
} | ||
|
||
public void Separator() | ||
{ | ||
ImGuiNET.ImGui.Separator(); | ||
} | ||
|
||
public void Spacing() | ||
{ | ||
ImGuiNET.ImGui.Spacing(); | ||
} | ||
|
||
public void BeginGroup() | ||
{ | ||
ImGuiNET.ImGui.BeginGroup(); | ||
} | ||
|
||
public void BeginMenu(string label) | ||
{ | ||
ImGuiNET.ImGui.BeginMenu(label); | ||
} | ||
|
||
public void End() | ||
{ | ||
ImGuiNET.ImGui.End(); | ||
} | ||
|
||
public void DockSpaceOverViewport() | ||
{ | ||
ImGuiNET.ImGui.DockSpaceOverViewport(); | ||
} | ||
|
||
public void ShowDemoWindow() | ||
{ | ||
ImGuiNET.ImGui.ShowDemoWindow(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using JetBrains.Annotations; | ||
|
||
namespace Hypercube.ImGui; | ||
|
||
[PublicAPI] | ||
public enum ImGuiDirection | ||
{ | ||
None = -1, | ||
|
||
Left = 0, | ||
Right = 1, | ||
Up = 2, | ||
Down = 3, | ||
|
||
Count = 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
using Hypercube.Graphics.Windowing; | ||
using Hypercube.ImGui.Implementations; | ||
using JetBrains.Annotations; | ||
|
||
namespace Hypercube.ImGui; | ||
|
||
[PublicAPI] | ||
public static class ImGuiFactory | ||
{ | ||
public static IImGuiController Create(WindowHandle window) | ||
{ | ||
return new GlfwImGuiController(window); | ||
return new OpenGLImGuiController(window); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters