diff --git a/src/inferno.cpp b/src/inferno.cpp index 1b15a5c..6b3652a 100644 --- a/src/inferno.cpp +++ b/src/inferno.cpp @@ -43,6 +43,18 @@ void Inferno::uiPreset() spdlog::info("LAYOUT SET TO DEFAULT"); } +void Inferno::input() +{ + // KBD & MOUSE + static double dxpos, dypos; + double xpos, ypos; + glfwGetCursorPos(mWin->getGLFWWindow(), &xpos, &ypos); + + mouseDelta.x = (int)(dxpos - xpos); + mouseDelta.y = (int)(dypos - ypos); + dxpos = xpos; dypos = ypos; +} + int Inferno::run() { mWin->setFPSMode(); @@ -58,11 +70,6 @@ int Inferno::run() if (ImGui::DockBuilderGetNode(dockspace_id) == NULL) { this->uiPreset(); } ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags); - // KBD & MOUSE - double xpos, ypos; - glfwGetCursorPos(mWin->getGLFWWindow(), &xpos, &ypos); - - std::cout << mouseDelta.x << " " << mouseDelta.y << std::endl; ImGui::Begin("Preview"); diff --git a/src/inferno.hpp b/src/inferno.hpp index 24f7f16..280f7b2 100644 --- a/src/inferno.hpp +++ b/src/inferno.hpp @@ -18,6 +18,8 @@ public: ~Inferno(); void uiPreset(); + + void input(); int run(); public: