RR_SURFACE_PYRAMID
};
+/*! Create a new RrSurface prototype that can't render. A prototype can be
+ copied to a new RrSurface that can render. */
+struct RrSurface *RrSurfaceNewProto(enum RrSurfaceType type,
+ int numtex);
/*! Create a new top-level RrSurface for a Window. */
struct RrSurface *RrSurfaceNew(struct RrInstance *inst,
enum RrSurfaceType type,
return sur;
}
+struct RrSurface *RrSurfaceNewProto(enum RrSurfaceType type,
+ int numtex)
+{
+ struct RrSurface *sur;
+
+ sur = surface_new(type, numtex);
+ sur->inst = inst;
+ sur->win = None;
+ sur->parent = NULL;
+ return sur;
+}
+
struct RrSurface *RrSurfaceNew(struct RrInstance *inst,
enum RrSurfaceType type,
Window win,
break;
case RR_SURFACE_NONPLANAR:
assert(0);
+ break;
}
sur->ntextures = orig->ntextures;
sur->texture = malloc(sizeof(struct RrTexture) * sur->ntextures);
#define __render_surface_h
#include "render.h"
-
-union RrTextureData {
- int foo;
-};
-
-struct RrTexture {
- enum RrTextureType type;
- union RrTextureData data;
-};
+#include "texture.h"
struct RrPlanarSurface {
enum RrSurfaceColorType colortype;
enum RrSurfaceType type;
union RrSurfaceData data;
- Window win; /* this can optionally be None if parent != NULL ... */
+ /* This member is created inside Render if parent != NULL, but is passed
+ in if parent == NULL and should not be destroyed!
+
+ Always check for this to be None before rendering it. Just skip by
+ (and assert) if it is None.
+ */
+ Window win; /* XXX this can optionally be None if parent != NULL ... */
int ntextures;
struct RrTexture *texture;