context_window.cpp is back
This commit is contained in:
parent
5a4bcd46bb
commit
2c6b505c56
3 changed files with 18 additions and 10 deletions
|
|
@ -59,6 +59,7 @@ target_sources(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
src/window.cpp
|
src/window.cpp
|
||||||
src/opengl_context.cpp
|
src/opengl_context.cpp
|
||||||
|
src/context_window.cpp
|
||||||
|
|
||||||
PUBLIC
|
PUBLIC
|
||||||
FILE_SET public_headers
|
FILE_SET public_headers
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,9 @@ namespace window {
|
||||||
public:
|
public:
|
||||||
ContextWindow() noexcept = delete;
|
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; }
|
[[nodiscard]] inline bool is_init() const { return init; }
|
||||||
};
|
};
|
||||||
|
|
|
||||||
15
src/context_window.cpp
Normal file
15
src/context_window.cpp
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
#include "context_window.hpp"
|
||||||
|
|
||||||
|
namespace window {
|
||||||
|
ContextWindow::ContextWindow(const GLFWerrorfun error_clbk) noexcept {
|
||||||
|
glfwSetErrorCallback(error_clbk);
|
||||||
|
if (glfwInit() == GLFW_FALSE) {
|
||||||
|
init = false;
|
||||||
|
}
|
||||||
|
init = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
ContextWindow::~ContextWindow() noexcept {
|
||||||
|
glfwTerminate();
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue