4 Copyright 2008-2012 Michel Pollet <buserror@gmail.com>
6 This file is part of simavr.
8 simavr is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 simavr is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with simavr. If not, see <http://www.gnu.org/licenses/>.
23 #include "c3context.h"
25 #include "c3driver_context.h"
32 c3context_p res = malloc(sizeof(*res));
33 return c3context_init(res, w, h);
42 memset(c, 0, sizeof(*c));
45 c->root = c3object_new(NULL);
57 c3object_dispose(c->root);
58 c3geometry_array_free(&c->projected);
66 if (!c->root || !c->root->dirty)
69 c3mat4 m = identity3D();
70 c3object_project(c->root, &m);
71 c3geometry_array_clear(&c->projected);
72 c3object_get_geometry(c->root, &c->projected);
80 for (int gi = 0; gi < c->projected.count; gi++) {
81 c3geometry_p g = c->projected.e[gi];