I want to know if it is possible to do the following in Java.I am working on a Java based OpenGL app using LWJGL wrapper.In the render loop on each frame render finish I am saving the pixels from the GL frame into image file.The problem is that the size of the frame sometimes is pretty large and it creates a noticeable overhead during the time of writing the pixels into file till the next start of the render loop.What I think to do is the following:
- On the frame render finish read the pixels from the Frame buffer.
- Start a new thread on a class which takes care of image file writing.
I wonder if such a technique will be of any help?Will the next render loop start without waiting to the image file save if it is done on a separate thread? Is it feasible at all with threads? What I want to achieve is that the GL render loop shouldn't wait for the file write but proceed with the rendering while fetching new pixel data at the end of each render loop into the file writing object.