diff --git a/Sources/OvEditor/src/OvEditor/Core/Context.cpp b/Sources/OvEditor/src/OvEditor/Core/Context.cpp index 3ae8069ff..a74d207f5 100644 --- a/Sources/OvEditor/src/OvEditor/Core/Context.cpp +++ b/Sources/OvEditor/src/OvEditor/Core/Context.cpp @@ -193,6 +193,7 @@ void OvEditor::Core::Context::ResetProjectSettings() projectSettings.Add("x_resolution", 1280); projectSettings.Add("y_resolution", 720); projectSettings.Add("fullscreen", false); + projectSettings.Add("resizable", false); projectSettings.Add("executable_name", "Game"); projectSettings.Add("start_scene", ""); projectSettings.Add("vsync", true); @@ -209,6 +210,7 @@ bool OvEditor::Core::Context::IsProjectSettingsIntegrityVerified() projectSettings.IsKeyExisting("x_resolution") && projectSettings.IsKeyExisting("y_resolution") && projectSettings.IsKeyExisting("fullscreen") && + projectSettings.IsKeyExisting("resizable") && projectSettings.IsKeyExisting("executable_name") && projectSettings.IsKeyExisting("start_scene") && projectSettings.IsKeyExisting("vsync") && diff --git a/Sources/OvEditor/src/OvEditor/Panels/ProjectSettings.cpp b/Sources/OvEditor/src/OvEditor/Panels/ProjectSettings.cpp index 32cd1b3d2..6dfa2b2de 100644 --- a/Sources/OvEditor/src/OvEditor/Panels/ProjectSettings.cpp +++ b/Sources/OvEditor/src/OvEditor/Panels/ProjectSettings.cpp @@ -85,6 +85,7 @@ OvEditor::Panels::ProjectSettings::ProjectSettings(const std::string & p_title, GUIDrawer::DrawScalar(columns, "Resolution X", GenerateGatherer("x_resolution"), GenerateProvider("x_resolution"), 1, 0, 10000); GUIDrawer::DrawScalar(columns, "Resolution Y", GenerateGatherer("y_resolution"), GenerateProvider("y_resolution"), 1, 0, 10000); GUIDrawer::DrawBoolean(columns, "Fullscreen", GenerateGatherer("fullscreen"), GenerateProvider("fullscreen")); + GUIDrawer::DrawBoolean(columns, "Allow resizing", GenerateGatherer("resizable"), GenerateProvider("resizable")); GUIDrawer::DrawString(columns, "Executable name", GenerateGatherer("executable_name"), GenerateProvider("executable_name")); GUIDrawer::DrawAsset(columns, "Window Icon", GenerateGatherer("window_icon"), GenerateProvider("window_icon"), OvTools::Utils::PathParser::EFileType::TEXTURE); } diff --git a/Sources/OvGame/src/OvGame/Core/Context.cpp b/Sources/OvGame/src/OvGame/Core/Context.cpp index 85fa0639c..efced47c5 100644 --- a/Sources/OvGame/src/OvGame/Core/Context.cpp +++ b/Sources/OvGame/src/OvGame/Core/Context.cpp @@ -73,7 +73,7 @@ OvGame::Core::Context::Context() : projectSettings.TryGet("x_resolution", targetWindowResolution[0]); projectSettings.TryGet("y_resolution", targetWindowResolution[1]); windowSettings.maximized = false; - windowSettings.resizable = false; + projectSettings.TryGet("resizable", windowSettings.resizable); projectSettings.TryGet("fullscreen", windowSettings.fullscreen); projectSettings.TryGet("samples", windowSettings.samples); @@ -176,6 +176,10 @@ OvGame::Core::Context::Context() : windowSettings.height, true, false, false ); + + window->FramebufferResizeEvent.AddListener([this](unsigned short width, unsigned short height) { + framebuffer->Resize(width, height); + }); } OvGame::Core::Context::~Context()