Enable multi-touch and don't hard-code the frame rate

This commit is contained in:
Joshua Granick
2013-12-01 19:53:33 -08:00
parent 4e01a41f6f
commit 155e75943e
2 changed files with 33 additions and 9 deletions

View File

@@ -127,6 +127,7 @@ namespace lime {
mForm->AddKeyEventListener (*this);
mForm->AddTouchEventListener (*this);
mForm->SetMultipointTouchEnabled (true);
bool ok = limeEGLCreate (mForm, sgWidth, sgHeight, 2, (sgFlags & wfDepthBuffer) ? 16 : 0, (sgFlags & wfStencilBuffer) ? 8 : 0, 0);
@@ -174,18 +175,31 @@ namespace lime {
void TizenApplication::OnForeground (void) {
if (mTimer != null) {
mTimer->Start (10);
}
Event activate (etActivate);
sgTizenFrame->HandleEvent (activate);
Event gotFocus (etGotInputFocus);
sgTizenFrame->HandleEvent (gotFocus);
Event poll (etPoll);
sgTizenFrame->HandleEvent (poll);
double next = sgTizenFrame->GetStage ()->GetNextWake () - GetTimeStamp ();
if (mTimer != null) {
if (next > 0) {
mTimer->Start (next * 1000.0);
} else {
mTimer->Start (10);
}
}
}
@@ -223,11 +237,21 @@ namespace lime {
}
mTimer->Start (10);
Event poll (etPoll);
sgTizenFrame->HandleEvent (poll);
double next = sgTizenFrame->GetStage ()->GetNextWake () - GetTimeStamp ();
if (next > 0) {
mTimer->Start (next * 1000.0);
} else {
mTimer->Start (10);
}
}

View File

@@ -24,7 +24,7 @@
typedef unsigned char uint8;
#define STREAM_BUFFER_SIZE (4096 * 4)
#define STREAM_BUFFER_SIZE (4096 * 8)
namespace lime
{