3.7. s3d_push_polygons

#include <s3d.h>

int s3d_push_polygons(int object, unsigned long *pbuf, unsigned short n );

as for vertices, you can push arrays of polygons to have greater performance. the pbuf should contain n polygons which consist of 4 unsigned long values of 3 vertices indeces and 1 material index.


unsigned long pbuf[] = { 0,1,2,0};
int oid=s3d_new_object();   /* create a new object */
s3d_push_vertex(oid,0.0,0.0,0.0);
s3d_push_vertex(oid,0.0,1.0,0.0);
s3d_push_vertex(oid,1.0,0.0,0.0);
s3d_push_material(oid,0.3,0.0,0.0, 1.0,1.0,1.0, 1.0,0.0,0.0);
s3d_push_polygon_array(oid,pbuf,1);
/* push one polygon with the pbuf data */