Domanda

For example I have 2 layers: background and image. In my case I must show or hide an image on zoom value changed (simply float variable).

The only solution I know is to keep 2 various frame buffers for both background and image and not to draw the image when it is not necessary.

But is it possible to do this in an easier way?

È stato utile?

Soluzione

Just don't pass the geometry to glDrawArrays() for the layer you want to hide when the zoom occurs. OpenGL ES completely re-renders everything every frame. You should have a glClear() call at the start of your frame render loop. So, removing something is done by just not sending its triangles. You might need to divide your geometry into separate lists for each layer.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top