I am using OpenGL ES for drawing in an Android application.
I want to write a function called from a user interface thread that will invoke a rendering thread, and ask it to read and return the image to the caller.
I was thinking about using Future so that the UI thread would sleep when the visualization stream was recording image data (this operation is very fast, so the user will not feel that the application has stopped responding).
But I'm at a loss on how to send Future to the rendering stream. All the examples I found create their own threads and then represent the future of these threads. The GLSurfaceView documentation mentions "The queueEvent () method is used to securely communicate between the user interface stream and the rendering stream. If you prefer, you can use some other method of transferring through Java pipes, for example, synchronized methods in the Renderer class itself." so it seems like using Future instead of calling is queueEvent()possible, but I have no idea how to do this.
source
share