X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fscr_game.c;fp=src%2Fscr_game.c;h=112b6fffc2dac04c1b8f75e86ec8ff1c0cdee810;hb=487d801f62b3f7cea009b5e560cfd06e57170970;hp=0b5f2b966cc57822f36da71bba9c1a44d0f56d57;hpb=103b67f9f1e041dc5f6ffbb59004ebe846e3f3f9;p=deeprace diff --git a/src/scr_game.c b/src/scr_game.c index 0b5f2b9..112b6ff 100644 --- a/src/scr_game.c +++ b/src/scr_game.c @@ -5,6 +5,7 @@ #include "miniglut.h" #include "game.h" #include "util.h" +#include "goat3d.h" static int ginit(void); static void gdestroy(void); @@ -27,13 +28,44 @@ struct game_screen scr_game = { static float cam_theta, cam_phi = 20, cam_dist = 10; static float cam_pan[3]; +static struct goat3d *gscn; +static int dlist; + + static int ginit(void) { + int i, num, nfaces; + + if(!(gscn = goat3d_create()) || goat3d_load(gscn, "data/track1.g3d")) { + return -1; + } + + dlist = glGenLists(1); + glNewList(dlist, GL_COMPILE); + num = goat3d_get_node_count(gscn); + for(i=0; i