diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index 41bdaffe..03ef592d 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -2366,6 +2366,7 @@ namespace Nuake { auto window = Window::Get(); window->SetDecorated(true); window->SetSize({ 1900, 1000 }); + window->Maximize(); window->Center(); frameCount = 0; return; diff --git a/Nuake/Engine.cpp b/Nuake/Engine.cpp index 88093853..9e15d22c 100644 --- a/Nuake/Engine.cpp +++ b/Nuake/Engine.cpp @@ -2,14 +2,14 @@ #include "src/Physics/PhysicsManager.h" #include -#include "src/Core/Input.h" -#include "src/Core/FileSystem.h" -#include "src/Scripting/ScriptingEngine.h" -#include "src/Audio/AudioManager.h" #include "src/AI/NavManager.h" -#include "src/Threading/JobSystem.h" +#include "src/Audio/AudioManager.h" +#include "src/Core/FileSystem.h" +#include "src/Core/Input.h" #include "src/Rendering/Renderer.h" #include "src/Rendering/Renderer2D.h" +#include "src/Scripting/ScriptingEngine.h" +#include "src/Threading/JobSystem.h" #include #include @@ -52,7 +52,7 @@ namespace Nuake s_LastFrameTime = s_Time; // Dont update if no scene is loaded. - if (s_CurrentWindow->GetScene()) + if (s_CurrentWindow->GetScene()) { float scaledTimeStep = s_TimeStep * s_TimeScale; s_CurrentWindow->Update(scaledTimeStep); @@ -66,7 +66,7 @@ namespace Nuake s_FixedUpdateDifference += s_TimeStep; // Fixed update - while (s_FixedUpdateDifference >= s_FixedUpdateRate) + while (s_FixedUpdateDifference >= s_FixedUpdateRate) { s_CurrentWindow->FixedUpdate(s_FixedUpdateRate * s_TimeScale); @@ -81,7 +81,7 @@ namespace Nuake void Engine::EnterPlayMode() { - s_LastFrameTime = (float)glfwGetTime();; // Reset timestep timer. + s_LastFrameTime = (float)glfwGetTime(); // Reset timestep timer. // Dont trigger init if already in player mode. if (GetGameState() == GameState::Playing) diff --git a/Nuake/src/Window.cpp b/Nuake/src/Window.cpp index d6e97fd3..a0717ee7 100644 --- a/Nuake/src/Window.cpp +++ b/Nuake/src/Window.cpp @@ -272,6 +272,18 @@ namespace Nuake glfwSetWindowAttrib(m_Window, GLFW_DECORATED, enabled); } + void Window::SetFullScreen(bool enabled) + { + const auto monitor = glfwGetPrimaryMonitor(); + const GLFWvidmode* mode = glfwGetVideoMode(monitor); + glfwSetWindowMonitor(m_Window, monitor, 0, 0, mode->width, mode->height, GLFW_DONT_CARE); + } + + void Window::Maximize() + { + glfwMaximizeWindow(m_Window); + } + void Window::InitImgui() { ImGui::CreateContext(); diff --git a/Nuake/src/Window.h b/Nuake/src/Window.h index 209f2569..a098febd 100644 --- a/Nuake/src/Window.h +++ b/Nuake/src/Window.h @@ -46,9 +46,9 @@ namespace Nuake void SetWindowIcon(const std::string& path); void SetVSync(bool enabled); - void SetDecorated(bool enabled); - + void SetFullScreen(bool enabled); + void Maximize(); private: const std::string DEFAULT_TITLE = "Untitled Window"; const uint32_t DEFAULT_WIDTH = 1280;