removed that backwards ass shit

This commit is contained in:
Ben Kyd
2022-11-01 00:24:25 +00:00
parent e22d070b16
commit f48d4bea0d
5 changed files with 28 additions and 55 deletions

View File

@@ -22,7 +22,6 @@ void Window::init(std::string title, int width, int height)
setupGLFW(title);
glfwSetKeyCallback(getGLFWWindow(), glfwKeyCallback);
glfwSetCursorPosCallback(getGLFWWindow(), glfwMouseCallback);
setupImGui();
}
@@ -66,21 +65,11 @@ void Window::setKeyCallback(KeyCallback callback)
mKeyCallback = callback;
}
void Window::setMouseCallback(MouseCallback callback)
{
mMouseCallback = callback;
}
KeyCallback Window::getKeyCallback()
{
return mKeyCallback;
}
MouseCallback Window::getMouseCallback()
{
return mMouseCallback;
}
bool Window::newFrame()
{
glfwPollEvents();
@@ -196,14 +185,6 @@ void Window::glfwKeyCallback(GLFWwindow* window, int key, int scancode, int acti
}
}
void Window::glfwMouseCallback(GLFWwindow* window, double xpos, double ypos)
{
if (Window::GetInstance().getMouseCallback() != nullptr)
{
Window::GetInstance().getMouseCallback()(xpos, ypos);
}
}
void Window::glfwErrorCallback(int error, const char* description) {
spdlog::error("[GLFW {0}] {1}", error, description);
}