fix: glfw window create before glfw init

This commit is contained in:
light7734 2025-07-16 13:56:28 +03:30
parent 44baac6a52
commit 207cd48a7a
Signed by: light7734
GPG key ID: 8C30176798F1A6BA

View file

@ -16,8 +16,7 @@ auto Window::create(const std::function<void(Event &)> &callback) -> Scope<Windo
}
lWindow::lWindow(std::function<void(Event &)> callback)
: m_handle(glfwCreateWindow(1u, 1u, "", nullptr, nullptr))
, m_event_callback(std::move(std::move(callback)))
: m_event_callback(std::move(std::move(callback)))
{
ensure(glfwInit(), "Failed to initialize 'glfw'");
@ -26,7 +25,8 @@ lWindow::lWindow(std::function<void(Event &)> callback)
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
// NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
m_handle = glfwCreateWindow(1u, 1u, "", nullptr, nullptr);
ensure(m_handle, "Failed to create 'GLFWwindow'");
glfwSetWindowUserPointer(m_handle, &m_event_callback);