Capture an opengl Window

Hi

I need to capture an opengl window.
The application I want to capture is not Java, but opengl.
My first approach was just to capture the screen which works quite well. But if some other windows overlaps the opengl window this approach fails.
I know that using c++ it is possible to capture an opengl window by using e.g. GLC (http://nullkey.ath.cx/projects/glc/wiki). The opengl window can be covered by another window, but capturing still works.

Is it possible to do this with java too?

Thanks

The pixel ownership test (google it) means that even if this works in C++, it’s undefined behaviour and not guaranteed to work in all cases. Specifically, this tends to work on nVidia cards but fail on ATi and Intel chips).

If you’re trying to capture a 3rd party app then I believe there is no robust way to do this.

Well if it just works on nvidia cards its okay. Somewhere i read that using linux it should always work. Thats also my experience.

So I may ask again, is it possible to use glreadpixel or something similar inside my java program to capture the 3rd party opengl window?