diff --git a/src/gui.cpp b/src/gui.cpp index 005948a..c898401 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -24,16 +24,25 @@ gui::Gui::~Gui() noexcept { void gui::Gui::render_gui() { if (initialized) { + constexpr ImGuiWindowFlags flags = ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_NoResize | + ImGuiWindowFlags_NoCollapse | + ImGuiWindowFlags_NoTitleBar; + ImGui_ImplOpenGL3_NewFrame(); ImGui_ImplGlfw_NewFrame(); ImGui::NewFrame(); //TODO GUI - if (!ImGui::Begin("Billy")) { - ImGui::End(); - ImGui::Render(); - return; + { + const ImGuiViewport &viewport = *ImGui::GetMainViewport(); + ImGui::SetNextWindowPos(viewport.Pos); + ImGui::SetNextWindowSize(viewport.Size); } + + // Never collapsed. + ImGui::Begin("Billy", nullptr, flags); + ImGui::Text("Hello world!"); ImGui::Text("Average framerate: %.3f ms/frame (%.1f FPS)", 1000.f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);