I am using OpenGL ES to perform drawing in an Android app.
I want to write a function called from the UI thread which would call the renderer thread and get it to read and return the image to the caller.
I was thinking about using a Future so that the UI thread would sleep while the renderer thread writes the image data (that operation is very fast, so the user would not feel like the app became unresponsive).
But I am at a loss about how to submit the Future to the renderer thread. All the examples I found create their own threads and then submit the future to these threads. The documentation about GLSurfaceView mentions "The queueEvent() method is used to safely communicate between the UI thread and the rendering thread. If you prefer, you can use some other Java cross-thread communication technique, such as synchronized methods on the Renderer class itself." so it looks like using a Future instead of calling queueEvent() is possible, but I have no idea how to do that.