Question

As already mentioned this line of code

setRenderMode(GLSurfaceView.RENDERMODE_CONTINUOUSLY);

causes my application to flicker weardly. That means if I changed it to

setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);

it stops flickering.

The device I am on is a ASUS Padfone a86.

Do you have ideas how to fix this?

Was it helpful?

Solution

There are two possibilities: the OS is doing something wrong, or your app is doing something wrong.

If you don't see flicker in any other apps or system animations, it's unlikely to be the system at fault. You don't really describe the nature of the flicker, but there are a couple of common problems.

One possibility is that you're not fully redrawing the screen every time the onDrawFrame() is called. If you don't, the system will show a blank or previously-rendered frame. Another possibility is that you're updating state while onDrawFrame() is executing, so you're getting a frame with a partial update that leaves objects in strange places.

Of course, if you're getting the results you want with RENDERMODE_WHEN_DIRTY, you may want to just stick with it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top