Next | Prev | Up | Top | Contents | Index
Creating and Using Pixmaps
Integrating an OpenGL program with a pixmap is very similar to integrating it with a window. It involves the steps given below. (Note that Steps 1-3 and Step 6 are discussed in detail in "Integrating Your OpenGL Program With IRIS IM".)
- Open the connection to the X server.
- Choose a visual.
- Create a rendering context with the chosen visual.
This context must be indirect.
- Create an X pixmap using XCreatePixmap().
- Create a GLX pixmap using glXCreateGLXPixmap().
GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis,
Pixmap pixmap)
The GLX pixmap "wraps" the pixmap with ancillary buffers determined by vis (see Figure 4-2).
The pixmap parameter must specify a pixmap that has the same depth as the visual that vis points to (as indicated by the visual's GLX_BUFFER_SIZE value), or a BadMatch X protocol error results.
- Use glXMakeCurrent() to bind the pixmap to the context.
You can now render into the GLX pixmap.
Next | Prev | Up | Top | Contents | Index