fix: glfw window create before glfw init
This commit is contained in:
parent
44baac6a52
commit
207cd48a7a
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue