view3d
diff src/scene.h @ 1:7650e941805c
forgot two files
author | John Tsiombikas <nuclear@mutantstargoat.com> |
---|---|
date | Thu, 19 Jan 2012 00:17:49 +0200 |
parents | |
children | 7e982a61852a |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/scene.h Thu Jan 19 00:17:49 2012 +0200 1.3 @@ -0,0 +1,46 @@ 1.4 +#ifndef SCENE_H_ 1.5 +#define SCENE_H_ 1.6 + 1.7 +struct aabb { 1.8 + float min[3], max[3]; 1.9 +}; 1.10 + 1.11 +struct material { 1.12 + float kd[4]; 1.13 + float ks[4]; 1.14 + float shin; 1.15 + unsigned int tex; 1.16 +}; 1.17 + 1.18 +struct mesh { 1.19 + unsigned int vert_buf, norm_buf, tex_buf, idx_buf; 1.20 + int num_verts, num_faces; 1.21 + 1.22 + struct material mat; 1.23 + 1.24 + struct aabb bbox; 1.25 + 1.26 + struct mesh *next; 1.27 +}; 1.28 + 1.29 +struct light { 1.30 + float pos[4]; 1.31 + float color[4]; 1.32 + 1.33 + struct light *next; 1.34 +}; 1.35 + 1.36 +struct scene { 1.37 + struct mesh *meshes; 1.38 + struct light *lights; 1.39 + 1.40 + struct aabb bbox; 1.41 +}; 1.42 + 1.43 + 1.44 +int load_scene(struct scene *scn, const char *fname); 1.45 + 1.46 +void render_scene(struct scene *scn); 1.47 +void render_mesh(struct mesh *m); 1.48 + 1.49 +#endif /* SCENE_H_ */