Minor - Vsync toggle

New Method :

+ Set Vsync
+ Set Screen Width
+ Set Screen Height
+ Get Hwnd
+ Set Hwnd
+ IsWindowed
+ SetWindowed

New UI For Engine Settings :

+ Add Vsync Toggle to UI
This commit is contained in:
2025-01-10 20:43:36 +01:00
parent 79f266b479
commit bce659e55d
8 changed files with 111 additions and 5 deletions

View File

@@ -318,6 +318,11 @@ bool imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
showShaderWindow = true;
}
if (ImGui::Button("Open Engine Settings Window"))
{
showEngineSettingsWindow = true;
}
ImGui::End();
// Show windows if their corresponding variables are true
@@ -341,6 +346,11 @@ bool imguiManager::ImGuiWidgetRenderer(ApplicationClass* app)
WidgetShaderWindow(app);
}
if (showEngineSettingsWindow)
{
WidgetEngineSettingsWindow(app);
}
//render imgui
Render();
@@ -379,5 +389,19 @@ void imguiManager::WidgetLightWindow(ApplicationClass* app)
index++;
};
ImGui::End();
}
void imguiManager::WidgetEngineSettingsWindow(ApplicationClass* app)
{
ImGui::Begin("Engine Settings", &showEngineSettingsWindow);
// Checkbox for toggling vsync globally in the application class by calling the SetVsync function in the application class when the checkbox state changes
bool vsync = app->GetVsync();
if (ImGui::Checkbox("Vsync", &vsync))
{
app->SetVsync(vsync);
}
ImGui::End();
}