Skyler
Skyler

Reputation: 939

How to get X to render to an OpenGL texture?

I am trying to write a compositor, like Compiz, but with different graphical effects. I am stuck at the first step, though, which is that I can't find how to get X to render windows to a texture instead of to the framebuffer. Any advice on where to start?

Upvotes: 0

Views: 1146

Answers (1)

datenwolf
datenwolf

Reputation: 162297

X11 composition goes like following.

  1. you redirect windows into a offscreen area. The Composite extension has the functions for this
  2. you use the Damage extension to find out which windows did change their contents
  3. in the compositor you use the GLX_EXT_texture_from_pixmap extension to submit each windows' contents into corresponding OpenGL textures.
  4. you draw the textures into a composition layer window; the Composite extension provides you with a special screen layer, between the regular window layer and the screensaver layer in which to create the window composition is taking place in.

Upvotes: 3

Related Questions