modification to allow gui control through touch

This commit is contained in:
Jonathan Bosson
2017-05-05 14:00:12 -06:00
parent 824cd1be05
commit 7580688f88
2 changed files with 13 additions and 2 deletions

View File

@@ -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(

View File

@@ -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