]> icculus.org git repositories - dana/openbox.git/blob - render2/surface.h
add ability to set a texture to None
[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
8 struct RrNonPlanarSurface {
9     int foo;
10 };
11
12 union RrSurfaceData {
13     struct RrPlanarSurface planar;
14     struct RrNonPlanarSurface nonplanar;
15 };
16
17 struct RrSurface {
18     struct RrInstance *inst;
19
20     enum RrSurfaceType type;
21     union RrSurfaceData data;
22
23     /* This member is created inside Render if parent != NULL, but is passed
24        in if parent == NULL and should not be destroyed!
25
26        Always check for this to be None before rendering it. Just skip by
27        (and assert) if it is None.
28     */
29     Window win; /* XXX this can optionally be None if parent != NULL ... */
30
31     int ntextures;
32     struct RrTexture *texture;
33
34     struct RrSurface *parent;
35
36     int x;
37     int y;
38     int w;
39     int h;
40
41     int visible : 1;
42 };
43
44 struct RrTexture *RrSurfaceTexture(struct RrSurface *sur, int texnum);
45
46 #define RrSurfaceInstance(sur) ((sur)->inst)
47 #define RrSurfaceType(sur) ((sur)->type)
48
49 #define RrSurfaceParent(sur) ((sur)->parent)
50
51 #define RrSurfaceX(sur) ((sur)->x)
52 #define RrSurfaceY(sur) ((sur)->y)
53 #define RrSurfaceWidth(sur) ((sur)->w)
54 #define RrSurfaceHeight(sur) ((sur)->h)
55
56 #endif