diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index 5ac99d4b..33d0e58f 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -2458,7 +2458,7 @@ namespace Nuake { auto window = Window::Get(); window->SetDecorated(true); - //window->ShowTitleBar(false); + window->ShowTitleBar(false); window->SetSize({ 1600, 900 }); window->Center(); frameCount = 0; diff --git a/Nuake/src/Window.cpp b/Nuake/src/Window.cpp index 90141a57..444c8c56 100644 --- a/Nuake/src/Window.cpp +++ b/Nuake/src/Window.cpp @@ -59,7 +59,7 @@ int Window::Init() return -1; } - //ShowTitleBar(false); + ShowTitleBar(false); #ifdef NK_VK glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); @@ -72,7 +72,7 @@ int Window::Init() return -1; } - //SetWindowIcon("resources/Images/nuake-logo.png"); + SetWindowIcon("resources/Images/nuake-logo.png"); glfwMakeContextCurrent(this->window); //SetVSync(false); @@ -98,45 +98,45 @@ int Window::Init() //glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); // To make MacOS happy; should not be needed //glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); - //glfwSetWindowUserPointer(window, this); - // - //glfwSetWindowCloseCallback(window, [](GLFWwindow* nativeWindow) - // { - // Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); - // window->OnWindowClosed(*window); - // }); - // - //glfwSetWindowFocusCallback(window, [](GLFWwindow* nativeWindow, int focused) - // { - // Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); - // window->OnWindowFocused(*window, static_cast(focused)); - // }); - // - //glfwSetDropCallback(window, [](GLFWwindow* nativeWindow, int count, const char** paths) - // { - // std::vector filePaths; - // filePaths.reserve(count); - // - // int i; - // for (i = 0; i < count; i++) - // { - // std::string filePath = std::string(paths[i]); - // filePaths.push_back(filePath); - // } - // - // Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); - // window->OnDragNDropCallback(*window, filePaths); - // }); - // - //glfwSetTitlebarHitTestCallback(window, [](GLFWwindow* nativeWindow, int x, int y, int* hit) - //{ - // bool isHit = false; - // Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); - // - // window->TitlebarHitTest(*window, x, y, isHit); - // - // *hit = isHit; - //}); + glfwSetWindowUserPointer(window, this); + + glfwSetWindowCloseCallback(window, [](GLFWwindow* nativeWindow) + { + Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); + window->OnWindowClosed(*window); + }); + + glfwSetWindowFocusCallback(window, [](GLFWwindow* nativeWindow, int focused) + { + Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); + window->OnWindowFocused(*window, static_cast(focused)); + }); + + glfwSetDropCallback(window, [](GLFWwindow* nativeWindow, int count, const char** paths) + { + std::vector filePaths; + filePaths.reserve(count); + + int i; + for (i = 0; i < count; i++) + { + std::string filePath = std::string(paths[i]); + filePaths.push_back(filePath); + } + + Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); + window->OnDragNDropCallback(*window, filePaths); + }); + + glfwSetTitlebarHitTestCallback(window, [](GLFWwindow* nativeWindow, int x, int y, int* hit) + { + bool isHit = false; + Window* window = reinterpret_cast(glfwGetWindowUserPointer(nativeWindow)); + + window->TitlebarHitTest(*window, x, y, isHit); + + *hit = isHit; + }); #ifndef NK_VK // TODO: have clear color in environnement.