I am using GLUT library for my research/game.
In my game I have 25 windows created using
glutCreateWindow(title), and each of them have their own display callback registered using
I am trying to stream the screen of each of the 25 windows on my computer to another client which will do some processing with all the screen capture of the 25 windows.
Currently I am capturing the screen of each of the 25 windows with:
Just doing the call to
glReadPixels for each of the 25 windows slows my fps down to 7 fps.
However I require the fps to be at least 25 FPS, is there any way I can improve the fps?
I found a solution to this.
Conventional glReadPixels() blocks the pipeline and waits until all pixel data are transferred.Then, it returns control to the application.
Thus we can overcome this by making glReadPixels() asynchronous .
glReadPixels() with Pixel buffer object (PBO) can schedule asynchronous DMA transfer and returns immediately without stall.
Read more here : https://www.opengl.org/wiki/Pixel_Buffer_Object
For even better performance, you can even implement double or triple PBO layers.
I read through many sites and found that this site has the most detailed and easy to implement details: http://www.songho.ca/opengl/gl_pbo.html