{
c3context_project(c);
- c3geometry_array_p array = &c3context_view_get(c)->projected;
+ c3context_view_p v = c3context_view_get(c);
+
+ C3_DRIVER(c, context_view_draw, v);
+
+ c3geometry_array_p array = &v->projected;
for (int gi = 0; gi < array->count; gi++) {
c3geometry_p g = array->e[gi];
c3geometry_draw(g);
dirty : 1;
c3vec2 size; // in pixels. for fbo/textures/window
c3cam_t cam;
+ c3mat4 projection; // projection matrix
c3geometry_array_t projected;
struct {
* This is a wrapper around a "top level object", the list of projected
* geometries is kept, purged and resorted if the root object becomes
* dirty
- * TODO: Add the camera/eye/arcball control there
*/
typedef struct c3context_t {
int current;
c->current = view;
}
-
#endif /* __C3CONTEXT_H___ */
struct c3context_t;
struct c3driver_context_t;
struct c3geometry_t;
+struct c3context_view_t;
typedef struct c3driver_context_t {
/*
const struct c3driver_context_t *d,
struct c3geometry_t * g);
+ /*
+ * Called when starting to draw a context view(point)
+ */
+ void (*context_view_draw)(
+ struct c3context_t * c,
+ const struct c3driver_context_t *d,
+ struct c3context_view_t * ctx);
+
/*
* called when a geometry is disposed of, let the application
* delete resources like textures etc