Reputation: 147
i'm quite new on using opengl, i wonder if there is any way to pause or totally stop the onDrawFrame?
and is onSurfaceCreated always called every time i return to the game page?is there any way to stop from being called?
Upvotes: 1
Views: 1457
Reputation: 31846
You can use setRenderMode(RENDERMODE_WHEN_DIRTY)
to make the view only render when you call requestRender()
. (To revert to continuous rendering use setRenderMode(RENDERMODE_CONTINUOUSLY)
).
onSurfaceCreated
is called when the surface is created, but you most likely do not want to stop this method from executing, since without it you would be left without an option to begin loading your graphics. Instead try to preserve your View/Surface if you don't want to run it all the time.
Upvotes: 5