Game On! - Surviving OpenGL Context Loss

preview_player
Показать описание
For Android Game Devs who are working on their own engines, OpenGL Context Loss is a tricky process to get right. Every time your user rotates their screen, swaps apps, or opens a keyboard, all of your game's GPU content could be invalidated! In this video, Colt talks about the problem, and more importantly, how to fix it.
Рекомендации по теме
Комментарии
Автор

*Game On! episode: Surviving OpenGL Context Loss*

For Android game developers who are working on their own engines, OpenGL Context Loss is a tricky process to get right. Every time your user rotates their screen, swaps apps, or opens a keyboard, all of your game's GPU content could be invalidated! In this recent *Game On! DevByte*, Developer Advocate Colt McAnlis talks about the problem, and more importantly, how to fix it. 


#GameOn    #DevByte  

GoogleDevelopers
Автор

There is something I don't get here, I'm working with a game engine, and somehow I managed to keep my elgContext alive.

I have full control on the eglContext, the only object that can be destroyed is the EGL Surface, when I receive the onSurfaceDestroyed on my SurfaceView.
When this happens, I un-link it from my EGL Context, and I destroy it.
Then I wait for the onSurfaceCreated to re-create a new EGL Surface and link it back to the EGL Context with eglMakeCurrent().

Job done, no loss of EGL Context, no loss of OpenGL Ressources (shaders, buffers, textures).
What am I missing here?

lokib
welcome to shbcf.ru