move move move

This commit is contained in:
Ben Kyd
2022-11-01 00:28:37 +00:00
parent f48d4bea0d
commit b20caafa0e
2 changed files with 14 additions and 5 deletions

View File

@@ -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");

View File

@@ -18,6 +18,8 @@ public:
~Inferno();
void uiPreset();
void input();
int run();
public: