fprintf(stderr, "failed to allocate G3D context\n");
return -1;
}
+ st->opt = G3D_CLIP_FRUSTUM;
st->fill_mode = POLYFILL_FLAT;
for(i=0; i<G3D_NUM_MATRICES; i++) {
}
/* clipping */
- for(i=0; i<6; i++) {
- memcpy(tmpv, v, vnum * sizeof *v);
-
- if(clip_frustum(v, &vnum, tmpv, vnum, i) < 0) {
- /* polygon completely outside of view volume. discard */
- vnum = 0;
- break;
+ if(st->opt & G3D_CLIP_FRUSTUM) {
+ for(i=0; i<6; i++) {
+ memcpy(tmpv, v, vnum * sizeof *v);
+
+ if(clip_frustum(v, &vnum, tmpv, vnum, i) < 0) {
+ /* polygon completely outside of view volume. discard */
+ vnum = 0;
+ break;
+ }
}
- }
- if(!vnum) continue;
+ if(!vnum) continue;
+ }
for(i=0; i<vnum; i++) {
if(v[i].w != 0.0f) {