#include "c3object.h"
+#include "c3context.h"
#include "c3driver_object.h"
void
const c3driver_object_t * d,
c3geometry_array_p out)
{
- for (int oi = 0; oi < o->geometry.count; oi++)
- c3geometry_array_add(out, o->geometry.e[oi]);
+ // if this object is not visible in this view, exit
+ // there will be no geometry, so no drawing
+ uint16_t viewmask = (1 << o->context->current);
+ if (o->hidden & viewmask)
+ return;
+ for (int oi = 0; oi < o->geometry.count; oi++) {
+ c3geometry_p g = o->geometry.e[oi];
+ if (!(g->hidden & viewmask))
+ c3geometry_array_add(out, g);
+ }
for (int oi = 0; oi < o->objects.count; oi++)
c3object_get_geometry(o->objects.e[oi], out);
}
typedef struct c3object_t {
str_p name; //! optional name
int dirty : 1,
- visible : 1 /* TODO: Implement visible */;
+ hidden : 8 /* hidden bit mask, related to c3context's views */;
struct c3context_t * context; //! context this object is attached to
struct c3object_t * parent; //! Parent object
const struct c3driver_object_t ** driver; //! Driver stack