Context window is now header only
This commit is contained in:
parent
35f2bfe9e1
commit
1c6e844401
3 changed files with 10 additions and 19 deletions
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
#include "context_window.hpp"
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue