sgx error: background gpu access not permitted (solved)

sgx error: background gpu access not permitted (solved)
0.0 0



I have recently upgraded cocos2d-x to 0.9.2 (just before 0.10.0 came out, so this may no longer be an issue)

And had the following error message whenever my app went in to background:
`sgx error: background gpu access not permitted`

But I have found out how to solve it:

In void AppDelegate::applicationDidEnterBackground()

Add :

just before :


In void AppDelegate::applicationWillEnterForeground()



Just thought I would let people know in case anyone else has the same issue.


Thank you for your sharing.


Thank you very much.
I had the same issue, and this really fixes the problem.
Thanks again!


I have the same issue and this solution works, thanks!
But there is a problem.
I have an animation with 7 frames and when I press the home button I stop the animaiton on the 4th frame. And when I bring this app foreground the startanimation will start the 1st frame. So I will see a jump in the aniamtion loop.

Do you know a soultion or a workaround to this problem?



I did not pay attention if the animations started again from the beginning, but I suppose it is normal since adding stopAnimation stops the animations so if started again they will start from the beginning.
Perhaps a workaround would be to save the frame you have reached in applicationDidEnterBackground(), then in applicationWillEnterForeground() set frame of the animation to the saved frame to start the animation again from it.