]> icculus.org git repositories - dana/openbox.git/blob - render2/surface.h
add support for render to pixmap
[dana/openbox.git] / render2 / surface.h
1 #ifndef __render_surface_h
2 #define __render_surface_h
3
4 #include "render.h"
5 #include "texture.h"
6 #include "planar.h"
7 #include <glib.h>
8 #include <GL/glx.h>
9
10 struct RrNonPlanarSurface {
11     int foo;
12 };
13
14 union RrSurfaceData {
15     struct RrPlanarSurface planar;
16     struct RrNonPlanarSurface nonplanar;
17 };
18
19 struct RrSurface {
20     struct RrInstance *inst;
21
22     enum RrSurfaceType type;
23     union RrSurfaceData data;
24
25     /* This member is created inside Render if parent != NULL, but is passed
26        in if parent == NULL and should not be destroyed!
27
28        Always check for this to be None before rendering it. Just skip by
29        (and assert) if it is None.
30     */
31     Window win; /* XXX this can optionally be None if parent != NULL ... */
32
33     Window shape_base;
34     int shape_base_x;
35     int shape_base_y;
36
37     int ntextures;
38     struct RrTexture *texture;
39
40     struct RrSurface *parent;
41
42     int x;
43     int y;
44     int w;
45     int h;
46
47     int visible : 1;
48     Pixmap pixmap;
49     GLXPixmap glxpixmap;
50
51     GSList *children;
52 };
53
54 struct RrTexture *RrSurfaceTexture(struct RrSurface *sur, int texnum);
55
56 #define RrSurfaceInstance(sur) ((sur)->inst)
57 #define RrSurfaceType(sur) ((sur)->type)
58
59 #define RrSurfaceParent(sur) ((sur)->parent)
60
61 #define RrSurfaceX(sur) ((sur)->x)
62 #define RrSurfaceY(sur) ((sur)->y)
63 #define RrSurfaceWidth(sur) ((sur)->w)
64 #define RrSurfaceHeight(sur) ((sur)->h)
65 #define RrSurfacePixmap(sur) ((sur)->pixmap)
66 #define RrSurfaceGLXPixmap(sur) ((sur)->glxpixmap)
67 #define RrSurfaceChildren(sur) ((sur)->children)
68
69 #endif