ld33_umonster

diff src/room.cc @ 2:35349df5392d

wtf?
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 22 Aug 2015 23:55:21 +0300
parents
children 93ff21458a16
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/room.cc	Sat Aug 22 23:55:21 2015 +0300
     1.3 @@ -0,0 +1,38 @@
     1.4 +#include <stdio.h>
     1.5 +#include "opengl.h"
     1.6 +#include "room.h"
     1.7 +#include "game.h"
     1.8 +#include "object.h"
     1.9 +#include "scene.h"
    1.10 +#include "meshgen.h"
    1.11 +
    1.12 +static Scene scn;
    1.13 +
    1.14 +bool init_room()
    1.15 +{
    1.16 +	Matrix4x4 xform;
    1.17 +
    1.18 +	// generate room
    1.19 +	Mesh *mroom = new Mesh;
    1.20 +	gen_box(mroom, 100, 100, 100);
    1.21 +	//xform.set_translation(Vector3(0, 12.5, 0));
    1.22 +	mroom->apply_xform(xform);
    1.23 +	mroom->flip();
    1.24 +
    1.25 +	Object *oroom = new Object;
    1.26 +	oroom->set_mesh(mroom);
    1.27 +	oroom->rop.cast_shadows = false;
    1.28 +
    1.29 +	scn.add_object(oroom);
    1.30 +	return true;
    1.31 +}
    1.32 +
    1.33 +void cleanup_room()
    1.34 +{
    1.35 +	scn.clear();
    1.36 +}
    1.37 +
    1.38 +void draw_room()
    1.39 +{
    1.40 +	scn.draw();
    1.41 +}