Android render loop (wip) example base class (#97)

This commit is contained in:
saschawillems 2016-03-20 20:04:27 +01:00
parent 87fd1be105
commit c21d769b7f
2 changed files with 30 additions and 1 deletions

View file

@ -341,7 +341,35 @@ void VulkanExampleBase::renderLoop()
}
}
#elif defined(__ANDROID__)
// todo : Android renderlopp
// todo : Application moved to background
while (1)
{
// Read all pending events.
int ident;
int events;
struct android_poll_source* source;
while ((ident = ALooper_pollAll(animating ? 0 : -1, NULL, &events, (void**)&source)) >= 0)
{
if (source != NULL)
{
source->process(androidApp, source);
}
if (androidApp->destroyRequested != 0)
{
// todo : free resources
//delete(vulkanExample);
return;
}
}
// Render frame
if (prepared)
{
render();
}
}
#elif defined(__linux__)
xcb_flush(connection);
while (!quit)