Perfect window now :D

This commit is contained in:
Pcornat 2022-01-11 22:01:57 +01:00
parent a65439a383
commit 941a8e98dc
Signed by: Pcornat
GPG Key ID: 2F3932FF46D9ECA0

View File

@ -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);