goat3d

diff src/goat3d.cc @ 19:b35427826b60

- added XML format reading support - wrote a rudimentary version of goatview
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 27 Sep 2013 06:58:37 +0300
parents 1d85d7dd0038
children d0260d80ae09
line diff
     1.1 --- a/src/goat3d.cc	Fri Sep 27 03:17:36 2013 +0300
     1.2 +++ b/src/goat3d.cc	Fri Sep 27 06:58:37 2013 +0300
     1.3 @@ -243,15 +243,7 @@
     1.4  	return (int)mesh->faces.size();
     1.5  }
     1.6  
     1.7 -#if __cplusplus >= 201103L
     1.8 -#define MOVE(x)	std::move(x)
     1.9 -#else
    1.10 -#define MOVE(x) x
    1.11 -#endif
    1.12 -
    1.13 -#define VECDATA(type, data, num) \
    1.14 -	MOVE(std::vector<type>((type*)(data), (type*)(data) + (num)))
    1.15 -
    1.16 +// VECDATA is in goat3d_impl.h
    1.17  void goat3d_set_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, const void *data, int vnum)
    1.18  {
    1.19  	if(attrib == GOAT3D_MESH_ATTR_VERTEX) {
    1.20 @@ -472,6 +464,16 @@
    1.21  	g->scn->add_mesh(mesh);
    1.22  }
    1.23  
    1.24 +int goat3d_get_mesh_count(struct goat3d *g)
    1.25 +{
    1.26 +	return g->scn->get_mesh_count();
    1.27 +}
    1.28 +
    1.29 +struct goat3d_mesh *goat3d_get_mesh(struct goat3d *g, int idx)
    1.30 +{
    1.31 +	return (goat3d_mesh*)g->scn->get_mesh(idx);
    1.32 +}
    1.33 +
    1.34  
    1.35  }	// extern "C"
    1.36