Color selection on android without screen flickering
I wrote an object selection algorithm that selects objects based on their color. I give each object a unique color and then I just need to use the glReadPixels method to check which object was selected.
this works fine and very fast, but the problem is that the frame is displayed on the screen with all the colors selected so that the screen blinks every time you select something.
so my question is, how do I write everything in the correct display buffer, but not display it on the screen to avoid these flashes?
a source to share
If you already have double buffering enabled, there is no need to create another offscreen buffer. Just skip the clipboard. So, in select mode, you provide your scene color-coded to the back buffer, read the selected pixel from glReadPixels, clear the back-buffer, and then render a normal frame in ONE back-buffer before replacing it with the front.
a source to share