Skip to content

Commit

Permalink
Added text and button methods
Browse files Browse the repository at this point in the history
Render broken when new methods called.
  • Loading branch information
Tornado-Technology committed Aug 10, 2024
1 parent 88b8402 commit de46595
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Hypercube.Client/Graphics/ImGui/ImGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ private void OnUpdateFrame(ref UpdateFrameEvent args)
private void OnRenderDrawing(ref RenderDrawingEvent args)
{
_controller.Begin("Test");

/*
_controller.Text("Test1");
_controller.Text("Test2");
_controller.Text("Test3");
_controller.Button("Also test");
*/

_controller.End();

_controller.Render();
Expand Down
2 changes: 2 additions & 0 deletions Hypercube.ImGui/IImGuiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ public interface IImGuiController
void Render();

void Begin(string name);
void Text(string label);
bool Button(string label);
void End();
}
10 changes: 10 additions & 0 deletions Hypercube.ImGui/Implementations/GlfwImGuiController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,16 @@ public void Begin(string name)
ImGuiNET.ImGui.Begin(name);
}

public void Text(string label)
{
ImGuiNET.ImGui.Text(label);
}

public bool Button(string label)
{
return ImGuiNET.ImGui.Button(label);
}

public void End()
{
ImGuiNET.ImGui.End();
Expand Down

0 comments on commit de46595

Please sign in to comment.