mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 08:14:45 +02:00
ScreenManager: Add support for direct async touch events
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E8B58922-9827-493D-81E0-4B6E6BD77171}</ProjectGuid>
|
||||
<ProjectGuid>{C4DF647E-80EA-4111-A0A8-218B1B711E18}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>native</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user