- Added application state events support for iOS platform.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5229 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
98c608dc7e
commit
e5383e1041
|
@ -52,28 +52,79 @@ namespace irr
|
|||
|
||||
- (void)applicationWillTerminate:(UIApplication*)application
|
||||
{
|
||||
if (Device != nil)
|
||||
{
|
||||
irr::SEvent ev;
|
||||
ev.EventType = irr::EET_APPLICATION_EVENT;
|
||||
ev.ApplicationEvent.EventType = irr::EAET_WILL_TERMINATE;
|
||||
|
||||
Device->postEventFromUser(ev);
|
||||
}
|
||||
|
||||
Terminate = true;
|
||||
}
|
||||
|
||||
- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application
|
||||
{
|
||||
if (Device != nil)
|
||||
{
|
||||
irr::SEvent ev;
|
||||
ev.EventType = irr::EET_APPLICATION_EVENT;
|
||||
ev.ApplicationEvent.EventType = irr::EAET_MEMORY_WARNING;
|
||||
|
||||
Device->postEventFromUser(ev);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication*)application
|
||||
{
|
||||
if (Device != nil)
|
||||
{
|
||||
irr::SEvent ev;
|
||||
ev.EventType = irr::EET_APPLICATION_EVENT;
|
||||
ev.ApplicationEvent.EventType = irr::EAET_WILL_PAUSE;
|
||||
|
||||
Device->postEventFromUser(ev);
|
||||
}
|
||||
|
||||
Active = false;
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication*)application
|
||||
{
|
||||
if (Device != nil)
|
||||
{
|
||||
irr::SEvent ev;
|
||||
ev.EventType = irr::EET_APPLICATION_EVENT;
|
||||
ev.ApplicationEvent.EventType = irr::EAET_DID_PAUSE;
|
||||
|
||||
Device->postEventFromUser(ev);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication*)application
|
||||
{
|
||||
if (Device != nil)
|
||||
{
|
||||
irr::SEvent ev;
|
||||
ev.EventType = irr::EET_APPLICATION_EVENT;
|
||||
ev.ApplicationEvent.EventType = irr::EAET_WILL_RESUME;
|
||||
|
||||
Device->postEventFromUser(ev);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication*)application
|
||||
{
|
||||
if (Device != nil)
|
||||
{
|
||||
irr::SEvent ev;
|
||||
ev.EventType = irr::EET_APPLICATION_EVENT;
|
||||
ev.ApplicationEvent.EventType = irr::EAET_DID_RESUME;
|
||||
|
||||
Device->postEventFromUser(ev);
|
||||
}
|
||||
|
||||
Active = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue