view3d

view src/scene.h @ 8:5562a637e5aa

load multiple files and concatenate them
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 23 Jan 2012 08:51:59 +0200
parents 7e982a61852a
children
line source
1 #ifndef SCENE_H_
2 #define SCENE_H_
4 struct aabb {
5 float min[3], max[3];
6 };
8 struct material {
9 float kd[4];
10 float ks[4];
11 float shin;
12 unsigned int tex;
13 };
15 struct mesh {
16 unsigned int vert_buf, norm_buf, tex_buf, idx_buf;
17 int num_verts, num_faces;
19 struct material mat;
21 struct aabb bbox;
23 struct mesh *next;
24 };
26 struct light {
27 float pos[4];
28 float color[4];
30 float cone_inner, cone_outer;
32 float att[3];
34 struct light *next;
35 };
37 struct scene {
38 struct mesh *meshes;
39 struct light *lights;
41 struct aabb bbox;
42 };
45 int init_scene(struct scene *scn);
46 int load_scene(struct scene *scn, const char *fname);
48 void render_scene(struct scene *scn);
49 void render_mesh(struct mesh *m, int pass);
51 #endif /* SCENE_H_ */