diff --git a/native.vcxproj b/native.vcxproj index d21ff5b0f2..00224bf93c 100644 --- a/native.vcxproj +++ b/native.vcxproj @@ -19,7 +19,7 @@ - {E8B58922-9827-493D-81E0-4B6E6BD77171} + {C4DF647E-80EA-4111-A0A8-218B1B711E18} Win32Proj native diff --git a/ui/screen.cpp b/ui/screen.cpp index c4994b85c7..2937a9dbe5 100644 --- a/ui/screen.cpp +++ b/ui/screen.cpp @@ -54,6 +54,18 @@ void ScreenManager::update(InputState &input) { } } +void ScreenManager::touch(int pointer, float x, float y, double time, TouchEvent event) +{ + if (dialog_.size()) { + dialog_.back()->touch(pointer, x, y, time, event); + return; + } + if (currentScreen_) + { + currentScreen_->touch(pointer, x, y, time, event); + } +} + void ScreenManager::render() { if (dialog_.size()) { dialog_.back()->render(); diff --git a/ui/screen.h b/ui/screen.h index 4c6af7bccb..59f6963404 100644 --- a/ui/screen.h +++ b/ui/screen.h @@ -17,6 +17,7 @@ #include "base/basictypes.h" #include "base/display.h" +#include "base/NativeApp.h" struct InputState; @@ -37,6 +38,7 @@ public: virtual void render() {} virtual void deviceLost() {} virtual void dialogFinished(const Screen *dialog, DialogResult result) {} + virtual void touch(int pointer, float x, float y, double time, TouchEvent event) {} ScreenManager *screenManager() { return screenManager_; } void setScreenManager(ScreenManager *sm) { screenManager_ = sm; } @@ -68,6 +70,9 @@ public: // Pops the dialog away. void finishDialog(const Screen *dialog, DialogResult result = DR_OK); + // Instant touch, separate from the update() mechanism. + void touch(int pointer, float x, float y, double time, TouchEvent event); + private: void pop(); Screen *topScreen();