7 static struct g3d_mesh mesh;
14 g3d_framebuffer(320, 200, framebuf);
15 g3d_viewport(0, 0, 320, 200);
17 g3d_clear_color(0, 0, 0);
19 g3d_matrix_mode(G3D_PROJECTION);
21 g3d_perspective(50.0f, 1.33333, 0.5, 500.0);
23 g3d_enable(G3D_CULL_FACE);
24 g3d_enable(G3D_DEPTH_TEST);
25 g3d_enable(G3D_LIGHTING);
26 g3d_enable(G3D_LIGHT0);
28 g3d_polygon_mode(G3D_GOURAUD);
30 gen_torus_mesh(&mesh, 2.0, 0.7, 24, 12);
34 void game_shutdown(void)
40 unsigned long msec = game_getmsec();
41 float tsec = (float)msec / 1000.0f;
43 g3d_clear(G3D_COLOR_BUFFER_BIT | G3D_DEPTH_BUFFER_BIT);
45 g3d_matrix_mode(G3D_MODELVIEW);
47 g3d_translate(0, 0, -8);
48 g3d_rotate(tsec * 50.0f, 1, 0, 0);
49 g3d_rotate(tsec * 30.0f, 0, 0, 1);
56 void game_keyboard(int key, int press)
58 if(key == 27) game_quit();
61 void game_mouse(int bn, int press, int x, int y)
65 void game_motion(int x, int y)