goat3d
diff src/goat3d.cc @ 41:da3f335e0069
revamped the visual studio project files
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 01 Dec 2013 01:31:53 +0200 |
parents | a5c5cec3cb88 |
children | 8da36540e2e9 |
line diff
1.1 --- a/src/goat3d.cc Sun Oct 13 10:14:19 2013 +0300 1.2 +++ b/src/goat3d.cc Sun Dec 01 01:31:53 2013 +0200 1.3 @@ -31,7 +31,7 @@ 1.4 1.5 extern "C" { 1.6 1.7 -struct goat3d *goat3d_create(void) 1.8 +GOAT3DAPI struct goat3d *goat3d_create(void) 1.9 { 1.10 goat3d *goat = new goat3d; 1.11 goat->flags = 0; 1.12 @@ -42,14 +42,14 @@ 1.13 return goat; 1.14 } 1.15 1.16 -void goat3d_free(struct goat3d *g) 1.17 +GOAT3DAPI void goat3d_free(struct goat3d *g) 1.18 { 1.19 delete g->search_path; 1.20 delete g->scn; 1.21 delete g; 1.22 } 1.23 1.24 -void goat3d_setopt(struct goat3d *g, enum goat3d_option opt, int val) 1.25 +GOAT3DAPI void goat3d_setopt(struct goat3d *g, enum goat3d_option opt, int val) 1.26 { 1.27 if(val) { 1.28 g->flags |= (1 << (int)opt); 1.29 @@ -58,12 +58,12 @@ 1.30 } 1.31 } 1.32 1.33 -int goat3d_getopt(const struct goat3d *g, enum goat3d_option opt) 1.34 +GOAT3DAPI int goat3d_getopt(const struct goat3d *g, enum goat3d_option opt) 1.35 { 1.36 return (g->flags >> (int)opt) & 1; 1.37 } 1.38 1.39 -int goat3d_load(struct goat3d *g, const char *fname) 1.40 +GOAT3DAPI int goat3d_load(struct goat3d *g, const char *fname) 1.41 { 1.42 FILE *fp = fopen(fname, "rb"); 1.43 if(!fp) { 1.44 @@ -94,7 +94,7 @@ 1.45 return res; 1.46 } 1.47 1.48 -int goat3d_save(const struct goat3d *g, const char *fname) 1.49 +GOAT3DAPI int goat3d_save(const struct goat3d *g, const char *fname) 1.50 { 1.51 FILE *fp = fopen(fname, "wb"); 1.52 if(!fp) { 1.53 @@ -107,7 +107,7 @@ 1.54 return res; 1.55 } 1.56 1.57 -int goat3d_load_file(struct goat3d *g, FILE *fp) 1.58 +GOAT3DAPI int goat3d_load_file(struct goat3d *g, FILE *fp) 1.59 { 1.60 goat3d_io io; 1.61 io.cls = fp; 1.62 @@ -118,7 +118,7 @@ 1.63 return goat3d_load_io(g, &io); 1.64 } 1.65 1.66 -int goat3d_save_file(const struct goat3d *g, FILE *fp) 1.67 +GOAT3DAPI int goat3d_save_file(const struct goat3d *g, FILE *fp) 1.68 { 1.69 goat3d_io io; 1.70 io.cls = fp; 1.71 @@ -129,7 +129,7 @@ 1.72 return goat3d_save_io(g, &io); 1.73 } 1.74 1.75 -int goat3d_load_io(struct goat3d *g, struct goat3d_io *io) 1.76 +GOAT3DAPI int goat3d_load_io(struct goat3d *g, struct goat3d_io *io) 1.77 { 1.78 if(!g->scn->load(io)) { 1.79 if(g->scn->loadxml(io)) { 1.80 @@ -139,7 +139,7 @@ 1.81 return 0; 1.82 } 1.83 1.84 -int goat3d_save_io(const struct goat3d *g, struct goat3d_io *io) 1.85 +GOAT3DAPI int goat3d_save_io(const struct goat3d *g, struct goat3d_io *io) 1.86 { 1.87 if(goat3d_getopt(g, GOAT3D_OPT_SAVEXML)) { 1.88 return g->scn->savexml(io) ? 0 : -1; 1.89 @@ -147,156 +147,156 @@ 1.90 return g->scn->save(io) ? 0 : -1; 1.91 } 1.92 1.93 -int goat3d_set_name(struct goat3d *g, const char *name) 1.94 +GOAT3DAPI int goat3d_set_name(struct goat3d *g, const char *name) 1.95 { 1.96 g->scn->set_name(name); 1.97 return 0; 1.98 } 1.99 1.100 -const char *goat3d_get_name(const struct goat3d *g) 1.101 +GOAT3DAPI const char *goat3d_get_name(const struct goat3d *g) 1.102 { 1.103 return g->scn->get_name(); 1.104 } 1.105 1.106 -void goat3d_set_ambient(struct goat3d *g, const float *amb) 1.107 +GOAT3DAPI void goat3d_set_ambient(struct goat3d *g, const float *amb) 1.108 { 1.109 g->scn->set_ambient(Vector3(amb[0], amb[1], amb[2])); 1.110 } 1.111 1.112 -void goat3d_set_ambient3f(struct goat3d *g, float ar, float ag, float ab) 1.113 +GOAT3DAPI void goat3d_set_ambient3f(struct goat3d *g, float ar, float ag, float ab) 1.114 { 1.115 g->scn->set_ambient(Vector3(ar, ag, ab)); 1.116 } 1.117 1.118 -const float *goat3d_get_ambient(const struct goat3d *g) 1.119 +GOAT3DAPI const float *goat3d_get_ambient(const struct goat3d *g) 1.120 { 1.121 return &g->scn->get_ambient().x; 1.122 } 1.123 1.124 // ---- materials ---- 1.125 -void goat3d_add_mtl(struct goat3d *g, struct goat3d_material *mtl) 1.126 +GOAT3DAPI void goat3d_add_mtl(struct goat3d *g, struct goat3d_material *mtl) 1.127 { 1.128 g->scn->add_material(mtl); 1.129 } 1.130 1.131 -struct goat3d_material *goat3d_create_mtl(void) 1.132 +GOAT3DAPI struct goat3d_material *goat3d_create_mtl(void) 1.133 { 1.134 return new goat3d_material; 1.135 } 1.136 1.137 -void goat3d_destroy_mtl(struct goat3d_material *mtl) 1.138 +GOAT3DAPI void goat3d_destroy_mtl(struct goat3d_material *mtl) 1.139 { 1.140 delete mtl; 1.141 } 1.142 1.143 -void goat3d_set_mtl_name(struct goat3d_material *mtl, const char *name) 1.144 +GOAT3DAPI void goat3d_set_mtl_name(struct goat3d_material *mtl, const char *name) 1.145 { 1.146 mtl->name = std::string(name); 1.147 } 1.148 1.149 -const char *goat3d_get_mtl_name(const struct goat3d_material *mtl) 1.150 +GOAT3DAPI const char *goat3d_get_mtl_name(const struct goat3d_material *mtl) 1.151 { 1.152 return mtl->name.c_str(); 1.153 } 1.154 1.155 -void goat3d_set_mtl_attrib(struct goat3d_material *mtl, const char *attrib, const float *val) 1.156 +GOAT3DAPI void goat3d_set_mtl_attrib(struct goat3d_material *mtl, const char *attrib, const float *val) 1.157 { 1.158 (*mtl)[attrib].value = Vector4(val[0], val[1], val[2], val[3]); 1.159 } 1.160 1.161 -void goat3d_set_mtl_attrib1f(struct goat3d_material *mtl, const char *attrib, float val) 1.162 +GOAT3DAPI void goat3d_set_mtl_attrib1f(struct goat3d_material *mtl, const char *attrib, float val) 1.163 { 1.164 goat3d_set_mtl_attrib4f(mtl, attrib, val, 0, 0, 1); 1.165 } 1.166 1.167 -void goat3d_set_mtl_attrib3f(struct goat3d_material *mtl, const char *attrib, float r, float g, float b) 1.168 +GOAT3DAPI void goat3d_set_mtl_attrib3f(struct goat3d_material *mtl, const char *attrib, float r, float g, float b) 1.169 { 1.170 goat3d_set_mtl_attrib4f(mtl, attrib, r, g, b, 1); 1.171 } 1.172 1.173 -void goat3d_set_mtl_attrib4f(struct goat3d_material *mtl, const char *attrib, float r, float g, float b, float a) 1.174 +GOAT3DAPI void goat3d_set_mtl_attrib4f(struct goat3d_material *mtl, const char *attrib, float r, float g, float b, float a) 1.175 { 1.176 (*mtl)[attrib].value = Vector4(r, g, b, a); 1.177 } 1.178 1.179 -const float *goat3d_get_mtl_attrib(struct goat3d_material *mtl, const char *attrib) 1.180 +GOAT3DAPI const float *goat3d_get_mtl_attrib(struct goat3d_material *mtl, const char *attrib) 1.181 { 1.182 return &(*mtl)[attrib].value.x; 1.183 } 1.184 1.185 -void goat3d_set_mtl_attrib_map(struct goat3d_material *mtl, const char *attrib, const char *mapname) 1.186 +GOAT3DAPI void goat3d_set_mtl_attrib_map(struct goat3d_material *mtl, const char *attrib, const char *mapname) 1.187 { 1.188 (*mtl)[attrib].map = goat3d_clean_filename(mapname); 1.189 } 1.190 1.191 -const char *goat3d_get_mtl_attrib_map(struct goat3d_material *mtl, const char *attrib) 1.192 +GOAT3DAPI const char *goat3d_get_mtl_attrib_map(struct goat3d_material *mtl, const char *attrib) 1.193 { 1.194 return (*mtl)[attrib].map.c_str(); 1.195 } 1.196 1.197 // ---- meshes ---- 1.198 -void goat3d_add_mesh(struct goat3d *g, struct goat3d_mesh *mesh) 1.199 +GOAT3DAPI void goat3d_add_mesh(struct goat3d *g, struct goat3d_mesh *mesh) 1.200 { 1.201 g->scn->add_mesh(mesh); 1.202 } 1.203 1.204 -int goat3d_get_mesh_count(struct goat3d *g) 1.205 +GOAT3DAPI int goat3d_get_mesh_count(struct goat3d *g) 1.206 { 1.207 return g->scn->get_mesh_count(); 1.208 } 1.209 1.210 -struct goat3d_mesh *goat3d_get_mesh(struct goat3d *g, int idx) 1.211 +GOAT3DAPI struct goat3d_mesh *goat3d_get_mesh(struct goat3d *g, int idx) 1.212 { 1.213 return (goat3d_mesh*)g->scn->get_mesh(idx); 1.214 } 1.215 1.216 -struct goat3d_mesh *goat3d_get_mesh_by_name(struct goat3d *g, const char *name) 1.217 +GOAT3DAPI struct goat3d_mesh *goat3d_get_mesh_by_name(struct goat3d *g, const char *name) 1.218 { 1.219 return (goat3d_mesh*)g->scn->get_mesh(name); 1.220 } 1.221 1.222 -struct goat3d_mesh *goat3d_create_mesh(void) 1.223 +GOAT3DAPI struct goat3d_mesh *goat3d_create_mesh(void) 1.224 { 1.225 return new goat3d_mesh; 1.226 } 1.227 1.228 -void goat3d_destroy_mesh(struct goat3d_mesh *mesh) 1.229 +GOAT3DAPI void goat3d_destroy_mesh(struct goat3d_mesh *mesh) 1.230 { 1.231 delete mesh; 1.232 } 1.233 1.234 -void goat3d_set_mesh_name(struct goat3d_mesh *mesh, const char *name) 1.235 +GOAT3DAPI void goat3d_set_mesh_name(struct goat3d_mesh *mesh, const char *name) 1.236 { 1.237 mesh->name = std::string(name); 1.238 } 1.239 1.240 -const char *goat3d_get_mesh_name(const struct goat3d_mesh *mesh) 1.241 +GOAT3DAPI const char *goat3d_get_mesh_name(const struct goat3d_mesh *mesh) 1.242 { 1.243 return mesh->name.c_str(); 1.244 } 1.245 1.246 -void goat3d_set_mesh_mtl(struct goat3d_mesh *mesh, struct goat3d_material *mtl) 1.247 +GOAT3DAPI void goat3d_set_mesh_mtl(struct goat3d_mesh *mesh, struct goat3d_material *mtl) 1.248 { 1.249 mesh->material = mtl; 1.250 } 1.251 1.252 -struct goat3d_material *goat3d_get_mesh_mtl(struct goat3d_mesh *mesh) 1.253 +GOAT3DAPI struct goat3d_material *goat3d_get_mesh_mtl(struct goat3d_mesh *mesh) 1.254 { 1.255 return (goat3d_material*)mesh->material; 1.256 } 1.257 1.258 -int goat3d_get_mesh_attrib_count(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib) 1.259 +GOAT3DAPI int goat3d_get_mesh_attrib_count(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib) 1.260 { 1.261 return (int)mesh->vertices.size(); 1.262 } 1.263 1.264 -int goat3d_get_mesh_face_count(struct goat3d_mesh *mesh) 1.265 +GOAT3DAPI int goat3d_get_mesh_face_count(struct goat3d_mesh *mesh) 1.266 { 1.267 return (int)mesh->faces.size(); 1.268 } 1.269 1.270 // VECDATA is in goat3d_impl.h 1.271 -void goat3d_set_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, const void *data, int vnum) 1.272 +GOAT3DAPI void goat3d_set_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, const void *data, int vnum) 1.273 { 1.274 if(attrib == GOAT3D_MESH_ATTR_VERTEX) { 1.275 mesh->vertices = VECDATA(Vector3, data, vnum); 1.276 @@ -331,19 +331,19 @@ 1.277 } 1.278 } 1.279 1.280 -void goat3d_add_mesh_attrib1f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.281 +GOAT3DAPI void goat3d_add_mesh_attrib1f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.282 float val) 1.283 { 1.284 goat3d_add_mesh_attrib4f(mesh, attrib, val, 0, 0, 1); 1.285 } 1.286 1.287 -void goat3d_add_mesh_attrib3f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.288 +GOAT3DAPI void goat3d_add_mesh_attrib3f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.289 float x, float y, float z) 1.290 { 1.291 goat3d_add_mesh_attrib4f(mesh, attrib, x, y, z, 1); 1.292 } 1.293 1.294 -void goat3d_add_mesh_attrib4f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.295 +GOAT3DAPI void goat3d_add_mesh_attrib4f(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, 1.296 float x, float y, float z, float w) 1.297 { 1.298 switch(attrib) { 1.299 @@ -372,12 +372,12 @@ 1.300 } 1.301 } 1.302 1.303 -void *goat3d_get_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib) 1.304 +GOAT3DAPI void *goat3d_get_mesh_attribs(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib) 1.305 { 1.306 return goat3d_get_mesh_attrib(mesh, attrib, 0); 1.307 } 1.308 1.309 -void *goat3d_get_mesh_attrib(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, int idx) 1.310 +GOAT3DAPI void *goat3d_get_mesh_attrib(struct goat3d_mesh *mesh, enum goat3d_mesh_attrib attrib, int idx) 1.311 { 1.312 switch(attrib) { 1.313 case GOAT3D_MESH_ATTR_VERTEX: 1.314 @@ -401,12 +401,12 @@ 1.315 } 1.316 1.317 1.318 -void goat3d_set_mesh_faces(struct goat3d_mesh *mesh, const int *data, int num) 1.319 +GOAT3DAPI void goat3d_set_mesh_faces(struct goat3d_mesh *mesh, const int *data, int num) 1.320 { 1.321 mesh->faces = VECDATA(Face, data, num); 1.322 } 1.323 1.324 -void goat3d_add_mesh_face(struct goat3d_mesh *mesh, int a, int b, int c) 1.325 +GOAT3DAPI void goat3d_add_mesh_face(struct goat3d_mesh *mesh, int a, int b, int c) 1.326 { 1.327 Face face; 1.328 face.v[0] = a; 1.329 @@ -415,12 +415,12 @@ 1.330 mesh->faces.push_back(face); 1.331 } 1.332 1.333 -int *goat3d_get_mesh_faces(struct goat3d_mesh *mesh) 1.334 +GOAT3DAPI int *goat3d_get_mesh_faces(struct goat3d_mesh *mesh) 1.335 { 1.336 return goat3d_get_mesh_face(mesh, 0); 1.337 } 1.338 1.339 -int *goat3d_get_mesh_face(struct goat3d_mesh *mesh, int idx) 1.340 +GOAT3DAPI int *goat3d_get_mesh_face(struct goat3d_mesh *mesh, int idx) 1.341 { 1.342 return mesh->faces.empty() ? 0 : mesh->faces[idx].v; 1.343 } 1.344 @@ -435,7 +435,7 @@ 1.345 static bool im_use[NUM_GOAT3D_MESH_ATTRIBS]; 1.346 1.347 1.348 -void goat3d_begin(struct goat3d_mesh *mesh, enum goat3d_im_primitive prim) 1.349 +GOAT3DAPI void goat3d_begin(struct goat3d_mesh *mesh, enum goat3d_im_primitive prim) 1.350 { 1.351 mesh->vertices.clear(); 1.352 mesh->normals.clear(); 1.353 @@ -452,7 +452,7 @@ 1.354 im_prim = prim; 1.355 } 1.356 1.357 -void goat3d_end(void) 1.358 +GOAT3DAPI void goat3d_end(void) 1.359 { 1.360 switch(im_prim) { 1.361 case GOAT3D_TRIANGLES: 1.362 @@ -494,7 +494,7 @@ 1.363 }; 1.364 } 1.365 1.366 -void goat3d_vertex3f(float x, float y, float z) 1.367 +GOAT3DAPI void goat3d_vertex3f(float x, float y, float z) 1.368 { 1.369 im_mesh->vertices.push_back(Vector3(x, y, z)); 1.370 if(im_use[GOAT3D_MESH_ATTR_NORMAL]) { 1.371 @@ -517,31 +517,31 @@ 1.372 } 1.373 } 1.374 1.375 -void goat3d_normal3f(float x, float y, float z) 1.376 +GOAT3DAPI void goat3d_normal3f(float x, float y, float z) 1.377 { 1.378 im_norm = Vector3(x, y, z); 1.379 im_use[GOAT3D_MESH_ATTR_NORMAL] = true; 1.380 } 1.381 1.382 -void goat3d_tangent3f(float x, float y, float z) 1.383 +GOAT3DAPI void goat3d_tangent3f(float x, float y, float z) 1.384 { 1.385 im_tang = Vector3(x, y, z); 1.386 im_use[GOAT3D_MESH_ATTR_TANGENT] = true; 1.387 } 1.388 1.389 -void goat3d_texcoord2f(float x, float y) 1.390 +GOAT3DAPI void goat3d_texcoord2f(float x, float y) 1.391 { 1.392 im_texcoord = Vector2(x, y); 1.393 im_use[GOAT3D_MESH_ATTR_TEXCOORD] = true; 1.394 } 1.395 1.396 -void goat3d_skin_weight4f(float x, float y, float z, float w) 1.397 +GOAT3DAPI void goat3d_skin_weight4f(float x, float y, float z, float w) 1.398 { 1.399 im_skinw = Vector4(x, y, z, w); 1.400 im_use[GOAT3D_MESH_ATTR_SKIN_WEIGHT] = true; 1.401 } 1.402 1.403 -void goat3d_skin_matrix4i(int x, int y, int z, int w) 1.404 +GOAT3DAPI void goat3d_skin_matrix4i(int x, int y, int z, int w) 1.405 { 1.406 im_skinmat.x = x; 1.407 im_skinmat.y = y; 1.408 @@ -550,77 +550,77 @@ 1.409 im_use[GOAT3D_MESH_ATTR_SKIN_MATRIX] = true; 1.410 } 1.411 1.412 -void goat3d_color3f(float x, float y, float z) 1.413 +GOAT3DAPI void goat3d_color3f(float x, float y, float z) 1.414 { 1.415 goat3d_color4f(x, y, z, 1.0f); 1.416 } 1.417 1.418 -void goat3d_color4f(float x, float y, float z, float w) 1.419 +GOAT3DAPI void goat3d_color4f(float x, float y, float z, float w) 1.420 { 1.421 im_color = Vector4(x, y, z, w); 1.422 im_use[GOAT3D_MESH_ATTR_COLOR] = true; 1.423 } 1.424 1.425 /* lights */ 1.426 -void goat3d_add_light(struct goat3d *g, struct goat3d_light *lt) 1.427 +GOAT3DAPI void goat3d_add_light(struct goat3d *g, struct goat3d_light *lt) 1.428 { 1.429 g->scn->add_light(lt); 1.430 } 1.431 1.432 -int goat3d_get_light_count(struct goat3d *g) 1.433 +GOAT3DAPI int goat3d_get_light_count(struct goat3d *g) 1.434 { 1.435 return g->scn->get_light_count(); 1.436 } 1.437 1.438 -struct goat3d_light *goat3d_get_light(struct goat3d *g, int idx) 1.439 +GOAT3DAPI struct goat3d_light *goat3d_get_light(struct goat3d *g, int idx) 1.440 { 1.441 return (goat3d_light*)g->scn->get_light(idx); 1.442 } 1.443 1.444 -struct goat3d_light *goat3d_get_light_by_name(struct goat3d *g, const char *name) 1.445 +GOAT3DAPI struct goat3d_light *goat3d_get_light_by_name(struct goat3d *g, const char *name) 1.446 { 1.447 return (goat3d_light*)g->scn->get_light(name); 1.448 } 1.449 1.450 1.451 -struct goat3d_light *goat3d_create_light(void) 1.452 +GOAT3DAPI struct goat3d_light *goat3d_create_light(void) 1.453 { 1.454 return new goat3d_light; 1.455 } 1.456 1.457 -void goat3d_destroy_light(struct goat3d_light *lt) 1.458 +GOAT3DAPI void goat3d_destroy_light(struct goat3d_light *lt) 1.459 { 1.460 delete lt; 1.461 } 1.462 1.463 1.464 /* cameras */ 1.465 -void goat3d_add_camera(struct goat3d *g, struct goat3d_camera *cam) 1.466 +GOAT3DAPI void goat3d_add_camera(struct goat3d *g, struct goat3d_camera *cam) 1.467 { 1.468 g->scn->add_camera(cam); 1.469 } 1.470 1.471 -int goat3d_get_camera_count(struct goat3d *g) 1.472 +GOAT3DAPI int goat3d_get_camera_count(struct goat3d *g) 1.473 { 1.474 return g->scn->get_camera_count(); 1.475 } 1.476 1.477 -struct goat3d_camera *goat3d_get_camera(struct goat3d *g, int idx) 1.478 +GOAT3DAPI struct goat3d_camera *goat3d_get_camera(struct goat3d *g, int idx) 1.479 { 1.480 return (goat3d_camera*)g->scn->get_camera(idx); 1.481 } 1.482 1.483 -struct goat3d_camera *goat3d_get_camera_by_name(struct goat3d *g, const char *name) 1.484 +GOAT3DAPI struct goat3d_camera *goat3d_get_camera_by_name(struct goat3d *g, const char *name) 1.485 { 1.486 return (goat3d_camera*)g->scn->get_camera(name); 1.487 } 1.488 1.489 -struct goat3d_camera *goat3d_create_camera(void) 1.490 +GOAT3DAPI struct goat3d_camera *goat3d_create_camera(void) 1.491 { 1.492 return new goat3d_camera; 1.493 } 1.494 1.495 -void goat3d_destroy_camera(struct goat3d_camera *cam) 1.496 +GOAT3DAPI void goat3d_destroy_camera(struct goat3d_camera *cam) 1.497 { 1.498 delete cam; 1.499 } 1.500 @@ -628,52 +628,52 @@ 1.501 1.502 1.503 // node 1.504 -void goat3d_add_node(struct goat3d *g, struct goat3d_node *node) 1.505 +GOAT3DAPI void goat3d_add_node(struct goat3d *g, struct goat3d_node *node) 1.506 { 1.507 g->scn->add_node(node); 1.508 } 1.509 1.510 -int goat3d_get_node_count(struct goat3d *g) 1.511 +GOAT3DAPI int goat3d_get_node_count(struct goat3d *g) 1.512 { 1.513 return g->scn->get_node_count(); 1.514 } 1.515 1.516 -struct goat3d_node *goat3d_get_node(struct goat3d *g, int idx) 1.517 +GOAT3DAPI struct goat3d_node *goat3d_get_node(struct goat3d *g, int idx) 1.518 { 1.519 return (goat3d_node*)g->scn->get_node(idx); 1.520 } 1.521 1.522 -struct goat3d_node *goat3d_get_node_by_name(struct goat3d *g, const char *name) 1.523 +GOAT3DAPI struct goat3d_node *goat3d_get_node_by_name(struct goat3d *g, const char *name) 1.524 { 1.525 return (goat3d_node*)g->scn->get_node(name); 1.526 } 1.527 1.528 -struct goat3d_node *goat3d_create_node(void) 1.529 +GOAT3DAPI struct goat3d_node *goat3d_create_node(void) 1.530 { 1.531 return new goat3d_node; 1.532 } 1.533 1.534 -void goat3d_set_node_name(struct goat3d_node *node, const char *name) 1.535 +GOAT3DAPI void goat3d_set_node_name(struct goat3d_node *node, const char *name) 1.536 { 1.537 node->set_name(name); 1.538 } 1.539 1.540 -const char *goat3d_get_node_name(const struct goat3d_node *node) 1.541 +GOAT3DAPI const char *goat3d_get_node_name(const struct goat3d_node *node) 1.542 { 1.543 return node->get_name(); 1.544 } 1.545 1.546 -void goat3d_set_node_object(struct goat3d_node *node, enum goat3d_node_type type, void *obj) 1.547 +GOAT3DAPI void goat3d_set_node_object(struct goat3d_node *node, enum goat3d_node_type type, void *obj) 1.548 { 1.549 node->set_object((Object*)obj); 1.550 } 1.551 1.552 -void *goat3d_get_node_object(const struct goat3d_node *node) 1.553 +GOAT3DAPI void *goat3d_get_node_object(const struct goat3d_node *node) 1.554 { 1.555 return (void*)node->get_object(); 1.556 } 1.557 1.558 -enum goat3d_node_type goat3d_get_node_type(const struct goat3d_node *node) 1.559 +GOAT3DAPI enum goat3d_node_type goat3d_get_node_type(const struct goat3d_node *node) 1.560 { 1.561 const Object *obj = node->get_object(); 1.562 if(dynamic_cast<const Mesh*>(obj)) { 1.563 @@ -689,43 +689,43 @@ 1.564 return GOAT3D_NODE_NULL; 1.565 } 1.566 1.567 -void goat3d_add_node_child(struct goat3d_node *node, struct goat3d_node *child) 1.568 +GOAT3DAPI void goat3d_add_node_child(struct goat3d_node *node, struct goat3d_node *child) 1.569 { 1.570 node->add_child(node); 1.571 } 1.572 1.573 -int goat3d_get_node_child_count(const struct goat3d_node *node) 1.574 +GOAT3DAPI int goat3d_get_node_child_count(const struct goat3d_node *node) 1.575 { 1.576 return node->get_children_count(); 1.577 } 1.578 1.579 -struct goat3d_node *goat3d_get_node_child(const struct goat3d_node *node, int idx) 1.580 +GOAT3DAPI struct goat3d_node *goat3d_get_node_child(const struct goat3d_node *node, int idx) 1.581 { 1.582 return (goat3d_node*)node->get_child(idx); 1.583 } 1.584 1.585 -void goat3d_set_node_position(struct goat3d_node *node, float x, float y, float z, long tmsec) 1.586 +GOAT3DAPI void goat3d_set_node_position(struct goat3d_node *node, float x, float y, float z, long tmsec) 1.587 { 1.588 node->set_position(Vector3(x, y, z), tmsec); 1.589 } 1.590 1.591 -void goat3d_set_node_rotation(struct goat3d_node *node, float qx, float qy, float qz, float qw, long tmsec) 1.592 +GOAT3DAPI void goat3d_set_node_rotation(struct goat3d_node *node, float qx, float qy, float qz, float qw, long tmsec) 1.593 { 1.594 node->set_rotation(Quaternion(qw, qx, qy, qz), tmsec); 1.595 } 1.596 1.597 -void goat3d_set_node_scaling(struct goat3d_node *node, float sx, float sy, float sz, long tmsec) 1.598 +GOAT3DAPI void goat3d_set_node_scaling(struct goat3d_node *node, float sx, float sy, float sz, long tmsec) 1.599 { 1.600 node->set_scaling(Vector3(sx, sy, sz), tmsec); 1.601 } 1.602 1.603 -void goat3d_set_node_pivot(struct goat3d_node *node, float px, float py, float pz) 1.604 +GOAT3DAPI void goat3d_set_node_pivot(struct goat3d_node *node, float px, float py, float pz) 1.605 { 1.606 node->set_pivot(Vector3(px, py, pz)); 1.607 } 1.608 1.609 1.610 -void goat3d_get_node_position(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr, long tmsec) 1.611 +GOAT3DAPI void goat3d_get_node_position(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr, long tmsec) 1.612 { 1.613 Vector3 pos = node->get_position(tmsec); 1.614 *xptr = pos.x; 1.615 @@ -733,7 +733,7 @@ 1.616 *zptr = pos.z; 1.617 } 1.618 1.619 -void goat3d_get_node_rotation(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr, float *wptr, long tmsec) 1.620 +GOAT3DAPI void goat3d_get_node_rotation(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr, float *wptr, long tmsec) 1.621 { 1.622 Quaternion q = node->get_rotation(tmsec); 1.623 *xptr = q.v.x; 1.624 @@ -742,7 +742,7 @@ 1.625 *wptr = q.s; 1.626 } 1.627 1.628 -void goat3d_get_node_scaling(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr, long tmsec) 1.629 +GOAT3DAPI void goat3d_get_node_scaling(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr, long tmsec) 1.630 { 1.631 Vector3 scale = node->get_scaling(tmsec); 1.632 *xptr = scale.x; 1.633 @@ -750,7 +750,7 @@ 1.634 *zptr = scale.z; 1.635 } 1.636 1.637 -void goat3d_get_node_pivot(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr) 1.638 +GOAT3DAPI void goat3d_get_node_pivot(const struct goat3d_node *node, float *xptr, float *yptr, float *zptr) 1.639 { 1.640 Vector3 pivot = node->get_pivot(); 1.641 *xptr = pivot.x; 1.642 @@ -759,7 +759,7 @@ 1.643 } 1.644 1.645 1.646 -void goat3d_get_node_matrix(const struct goat3d_node *node, float *matrix, long tmsec) 1.647 +GOAT3DAPI void goat3d_get_node_matrix(const struct goat3d_node *node, float *matrix, long tmsec) 1.648 { 1.649 node->get_xform(tmsec, (Matrix4x4*)matrix); 1.650 }