mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 11:09:37 -06:00
modification to allow gui control through touch
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
namespace openspace {
|
||||
|
||||
gui::GUI OnScreenGUIModule::gui;
|
||||
Touch OnScreenGUIModule::touchInput;
|
||||
|
||||
OnScreenGUIModule::OnScreenGUIModule()
|
||||
: OpenSpaceModule("OnScreenGUI")
|
||||
@@ -135,7 +136,10 @@ OnScreenGUIModule::OnScreenGUIModule()
|
||||
uint32_t mouseButtons = wrapper.mouseButtons(2);
|
||||
|
||||
double dt = std::max(wrapper.averageDeltaTime(), 0.0);
|
||||
|
||||
if (touchInput.active && mouseButtons == 0) {
|
||||
mouseButtons = touchInput.action;
|
||||
mousePosition = touchInput.pos;
|
||||
}
|
||||
// We don't do any collection of immediate mode user interface, so it is
|
||||
// fine to open and close a frame immediately
|
||||
gui.startFrame(
|
||||
|
||||
@@ -30,12 +30,19 @@
|
||||
#include <modules/onscreengui/include/gui.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
|
||||
struct Touch {
|
||||
bool active;
|
||||
glm::vec2 pos;
|
||||
uint32_t action;
|
||||
};
|
||||
|
||||
class OnScreenGUIModule : public OpenSpaceModule {
|
||||
public:
|
||||
OnScreenGUIModule();
|
||||
|
||||
static gui::GUI gui;
|
||||
static Touch touchInput;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user