I have just configured my Smartphone app to use the multithreaded version of CGapiApplication. This seems to have given me a small performance increase, but it also has caused one problem.
I have the app configured so that the user can minimize the application by pressing the '9' button. This is useful if people want to check a contact or something while they're playing without quiting the game.
In order to do this I just call the public function Minimize() when the key is pressed. When this happens my app becomes minimized as expected. The problem occurs when I try to restore the app (on the Smartphone this is done using the back key). It seems the phone tries to restore the game but it immediately loses focus again - the onscreen effect is basically that the game flashes up and then the phone returns to the home screen.
I assume that this is something to do with the fact that the threads for ProcessNextFrame and key press handling are different. Just to confuse me even more, when I receive an incoming call and the game minimizes for that I can restore simply by pressing the back key.
Is there something I'm missing? I have also tried setting a flag when the key is pressed and then calling Minimize() from the processnextframe method if the flag is true. This doesn't work either.
Any pointers would be great. Thanks in advance.
I have the app configured so that the user can minimize the application by pressing the '9' button. This is useful if people want to check a contact or something while they're playing without quiting the game.
In order to do this I just call the public function Minimize() when the key is pressed. When this happens my app becomes minimized as expected. The problem occurs when I try to restore the app (on the Smartphone this is done using the back key). It seems the phone tries to restore the game but it immediately loses focus again - the onscreen effect is basically that the game flashes up and then the phone returns to the home screen.
I assume that this is something to do with the fact that the threads for ProcessNextFrame and key press handling are different. Just to confuse me even more, when I receive an incoming call and the game minimizes for that I can restore simply by pressing the back key.
Is there something I'm missing? I have also tried setting a flag when the key is pressed and then calling Minimize() from the processnextframe method if the flag is true. This doesn't work either.
Any pointers would be great. Thanks in advance.