Framebuffer difference


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:

  1. If glReadPixels is slow, what should I use instead?

  2. 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?

  3. If this operation can’t be carried out effectively when using OpenGL, does DirectX make any difference?

Thank you.

This is an OS question and there is nothing in OpenGL that will help you (beyond glReadPixels).

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.

I supposed this I know that this is not the right forum, but what about DirectX? Is it possible to read out the framebuffer using DirectX calls?

What’s this ‘DirectX’ you keep mentioning? Never heard of that …

This is the OpenGL board!

[friendly hugmode]

Would you mind not to say such dirty words?

You can ask questions about <dirty>X at the forums of , and/or somewhere at one of the many great sites from our big friend Bill.


[/friendly hugmode]

#define <dirty> Direct

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).]

Hey I don’t like the guy either but I have no choice if my application runs only under Windows. I’d prefer it running on Linux but …

Thank you T2K for your intension to help
I’ll think in this direction.

Originally posted by T2k:
<dirty>3D … <dirty>Draw …

AFAIK <dirty>Draw doesn’t exist anymore with <dirty>X8 and 9 since it’s called <dirty>Graphics now.

And AFAIK the methods for accessing the framebuffer with <dirty>Graphics have been removed.

(not really sure about that since I’ve stopped used <dirty>X after version 6)