From 32b6c523c3612f2a06b0c1acfd61aeef4af372d8 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Fri, 30 May 2025 23:02:10 +0200 Subject: [PATCH] Correct safe function --- include/window.hpp | 13 ++----------- src/window.cpp | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/window.hpp b/include/window.hpp index da4af9a..1510091 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -12,18 +12,9 @@ namespace data { } namespace gui { - using modulesType = std::unordered_map; - class Window; - - [[nodiscard]] static std::optional create_window( - const GLFWerrorfun errorCallback, - GLFWframebuffersizefun framebufferCallback, - const bool debugOpengl, - GLFWwindow *shared, - std::initializer_list initializer) noexcept; - class Window final { public: + using modulesType = std::unordered_map; using windowPtr = GLFWwindow *; private: @@ -60,7 +51,7 @@ namespace gui { Window(Window &&window) noexcept = default; - [[nodiscard]] friend std::optional create_window( + [[nodiscard]] static std::optional create_window( const GLFWerrorfun errorCallback, GLFWframebuffersizefun framebufferCallback, const bool debugOpengl, diff --git a/src/window.cpp b/src/window.cpp index c24f7c9..7d7d401 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -111,7 +111,7 @@ namespace gui { glfwMakeContextCurrent(wwindow.get()); } - std::optional create_window( + std::optional Window::create_window( const GLFWerrorfun errorCallback, const GLFWframebuffersizefun framebufferCallback, const bool debugOpengl,