Search code examples
androidopengl-esglsurfaceview

GlSurfaceView is completly black when reloaded


In a nutshell, I use regular views for all my application except for on that uses a GLSurfaceView.

the UI flow works well. I can navigate form one to the over

except whith the GLSurfaceView

when I open the first time the GLSurfaceView everything works fine, but when I switch to another view and come back (pause menu) my view is completly black...

I tried several things and the closest I got from fixing it is to recreate the GLSurfaceView completly (but that takes too much time ...)

What I want is be able to do this: if(glView){ activity.setContentView(mView); }else{ activity.setContentView(id); } (id being an xml layout)

can somebody tell me what I'm doing wrong or point me to a tutorial that explain how to swap form GLViews to regular views

thanks a lot

Jason


Solution

  • after playing around a bit I figured out that when I load a new view my ogl context gets destroyed.

    since I couldn't see a way to prevent this and that regenerating all the texture took too much time I witch everything to ogl