Grabbing Output of Other OpenGL Applications


i want to grab the output of other opengl applications - and use this output as a texture in my app. MSDN says

“You can only share display lists with rendering contexts within the same process. However, not all rendering contexts in a process can share display lists. Rendering contexts can share display lists only if they use the same implementation of OpenGL functions. All client rendering contexts of a given pixel format can always share display lists.”

So sharing among processes is not possible.
As the msdn doc seems somewhat outdated ( talking about nt & win2k ) i would like to know if this is still the case. And what do they mean by saying “the same implementation of OpenGL functions”?

Thank You for your Help,

Simply forget about using OpenGL to capture that.

You neither have access to another (third party) process’ OpenGL context to issue any OpenGL calls in their context, neither can you create additional OpenGL contexts in their window.

You could only try to use Windows’ 2D API fuctions to grab (BitBlt) stuff from the screen (desktop window) like the OS built-in print screen functionality does, but that will not work reliably under Vista, since GDI and 3D HW acelerated surfaces are disjunct (e.g. will not work in a fullscreen app).

Good luck.

has anyone ever heard ( or even used ) this:…#LE13528-PARENT

EXT_import_context—The Import Context Extension

The import context extension, EXT_import_context, allows multiple X clients to share an indirect rendering context. The extension also adds some query routines to retrieve information associated with the current context.

-> but this is not available under Win/OsX ?


There is a two solutions:

  1. Using glIntercept (google for it). Write your app as plugin for glIntercept and modify host app output by intercepting SwapBuffers
  2. Using taksi project (visit sourceforge). This project is similar to well known FRAPS but you can modify it as you needs. In short… taksi can inject dll code into any process and hook on SwapBuffers. Before real SwapBuffers your code can be executed, so you can grab backbuffer and do it what you want with it. Taksi can hook on OpenGL, D3D8 and D3D9.

@yooyo: thanks for the ideas - never heard of taksi! had a look at the source, its jawdropping, featuring mechanisms like

// ALGORITHM: we overwrite the beginning of real wglSwapBuffers
// with a JMP instruction to our routine (OGL_WglSwapBuffers)

i think i have to think of this - will it really save me the
tedious task of pulling something in vram already to host
memory and pushing it to vram again?


Here is more about Injecting code tachniques:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.