X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgamescr.c;h=0bd7f7065cb8cdd248822b2e963992df78ac54a6;hb=e09f58ce22aa16e6fc68347b70c2be6a864f25b3;hp=de314ae927255f27cd55849d0f0707ca1e5d9a62;hpb=6ad6cf2cb2e82d8dcc1535a031a38eb991d2b396;p=vrtris diff --git a/src/gamescr.c b/src/gamescr.c index de314ae..0bd7f70 100644 --- a/src/gamescr.c +++ b/src/gamescr.c @@ -1,4 +1,6 @@ +#include "opengl.h" #include "screen.h" +#include "cmesh.h" static int init(void); static void cleanup(void); @@ -29,14 +31,23 @@ struct game_screen game_screen = { wheel }; +static struct cmesh *blkmesh; static int init(void) { + if(!(blkmesh = cmesh_alloc())) { + return -1; + } + if(cmesh_load(blkmesh, "data/noisecube.obj") == -1) { + fprintf(stderr, "failed to load block model\n"); + return -1; + } return 0; } static void cleanup(void) { + cmesh_free(blkmesh); } static void start(void) @@ -53,6 +64,9 @@ static void update(float dt) static void draw(void) { + glTranslatef(0, 0, 6); + + cmesh_draw(blkmesh); } static void reshape(int x, int y)