Qt: Implement "Free look"

This commit is contained in:
spycrab
2018-04-29 13:35:43 +02:00
parent e51cf8870e
commit bc51c34a96
2 changed files with 32 additions and 0 deletions

View File

@ -4,9 +4,12 @@
#pragma once
#include <array>
#include <QEvent>
#include <QWidget>
class QMouseEvent;
class QTimer;
class RenderWidget final : public QWidget
@ -31,7 +34,9 @@ private:
void OnHideCursorChanged();
void OnKeepOnTopChanged(bool top);
void SetFillBackground(bool fill);
void OnFreeLookMouseMove(QMouseEvent* event);
static constexpr int MOUSE_HIDE_DELAY = 3000;
QTimer* m_mouse_timer;
std::array<float, 2> m_last_mouse{};
};