How do I usually handle touch when I create a game with OpenGL?
Once I create a real object to show on the screen,
Create one more object that has the same shape as this.
This fake object has a different color value.
And I’m making a list of color values,
Then, when the touch comes in, draw fake objects and use the glReadPixels function.
The color value of this fake object is read out.
So if the real object matches the color value of the fake object it has, it treats it as touched.
And then I draw the real objects again.
I’ve implemented it this way with what I’ve seen.
It used to work well, but this time the screen flickers because of the fake object drawing.
I don’t think I’m going to use this method, but is there any other way?
I would like a search suggestion.