diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd400e..876337c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,6 @@ endif () add_library(${PROJECT_NAME} STATIC src/window.cpp - src/context_window.cpp src/opengl_context.cpp include/opengl_context.hpp ) diff --git a/include/context_window.hpp b/include/context_window.hpp index b7fee92..bb2315c 100644 --- a/include/context_window.hpp +++ b/include/context_window.hpp @@ -11,9 +11,17 @@ namespace window { public: ContextWindow() noexcept = delete; - explicit ContextWindow(const GLFWerrorfun error_clbk) noexcept; + explicit ContextWindow(const GLFWerrorfun error_clbk) noexcept { + glfwSetErrorCallback(error_clbk); + if (glfwInit() == GLFW_FALSE) { + init = false; + } + init = true; + } - ~ContextWindow() noexcept; + ~ContextWindow() noexcept { + glfwTerminate(); + } [[nodiscard]] inline bool is_init() const { return init; } }; diff --git a/src/context_window.cpp b/src/context_window.cpp deleted file mode 100644 index 8f81541..0000000 --- a/src/context_window.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "context_window.hpp" -#include - -namespace window { - ContextWindow::~ContextWindow() noexcept { - glfwTerminate(); - } - - ContextWindow::ContextWindow(const GLFWerrorfun error_clbk) noexcept { - glfwSetErrorCallback(error_clbk); - if (glfwInit() == GLFW_FALSE) { - init = false; - } - init = true; - } -} // window