I am trying to write a small program, which runs in the background and reads the framebuffer generated by other applications.
I need to first read the whole framebuffer and then detect the subsequent changes at a rate of ca. 15-25 fps. I would be very thankful for any hints:
If glReadPixels is slow, what should I use instead?
Is there a way to figure out the difference between the front and back buffer with a boolean operator using the GPU, so there would be no need to read the whole framebuffer?
If this operation can’t be carried out effectively when using OpenGL, does DirectX make any difference?
You can’t use OpenGL to access the contents of a window from another application. Not even with glReadPixels. You could attach an OpenGL context to it somehow, but that won’t guarantee you buffer access. And if you actually manage to use OpenGL on that window, it will fight with the other application’s output, never cooperate.
You can ask questions about <dirty>X at the forums of www.gamedev.net , www.flipcode.com and/or somewhere at one of the many great sites from our big friend Bill.
all you can try to do is to use GDI(you will fall into software mode, i think) to access the buffer, because you cannot connect an OpenGL RC to <dirty>3D and if you try it can happen that you disconnect <dirty>Draw from <dirty>3D, dont now, i dont use <dirty>X, but the other case: using <dirty>Draw could maybe work, …
but i think thats not you problem ?!? what you need to do is to use the command glCopyTexImage2D … and then draw the obtained texture to a DIB, that maybe work, but if it will be faster, dont know ?!?
[This message has been edited by T2k (edited 03-11-2002).]