Android render loop (wip) example base class (#97)
This commit is contained in:
parent
87fd1be105
commit
c21d769b7f
2 changed files with 30 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -157,6 +157,7 @@ public:
|
|||
HINSTANCE windowInstance;
|
||||
#elif defined(__ANDROID__)
|
||||
android_app* androidApp;
|
||||
bool animating = true;
|
||||
#elif defined(__linux__)
|
||||
struct {
|
||||
bool left = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue