# HG changeset patch # User John Tsiombikas # Date 1385309918 -7200 # Node ID 1868c5975f318fb6196298a69a42081fd1e08428 # Parent d061fe1a31ec9744df1bd8d044f3a448503a4a8b foo diff -r d061fe1a31ec -r 1868c5975f31 Makefile.in --- a/Makefile.in Sun Nov 24 14:00:14 2013 +0200 +++ b/Makefile.in Sun Nov 24 18:18:38 2013 +0200 @@ -23,6 +23,7 @@ pic = -fPIC endif +inc = -Isrc -Isrc/vr warn = -Wall libs_ldflags = -limago -lanim -lpsys -lvmath diff -r d061fe1a31ec -r 1868c5975f31 configure --- a/configure Sun Nov 24 14:00:14 2013 +0200 +++ b/configure Sun Nov 24 18:18:38 2013 +0200 @@ -183,7 +183,7 @@ emit '#undef USE_VR' fi - emit '#endif /* GOAT3DGFX_CONFIG_H_ */' + emit '#endif // GOAT3DGFX_CONFIG_H_' } diff -r d061fe1a31ec -r 1868c5975f31 src/camera.cc --- a/src/camera.cc Sun Nov 24 14:00:14 2013 +0200 +++ b/src/camera.cc Sun Nov 24 18:18:38 2013 +0200 @@ -1,5 +1,6 @@ #include "opengl.h" #include "camera.h" +#include "unistate.h" #include "vr.h" Camera::Camera() @@ -37,12 +38,12 @@ void Camera::use() const { - mult_matrix(matrix()); + set_view_matrix(matrix()); } void Camera::use_inverse() const { - mult_matrix(inv_matrix()); + set_view_matrix(inv_matrix()); } void Camera::input_move(float x, float y, float z) diff -r d061fe1a31ec -r 1868c5975f31 src/goat3dgfx.cc --- a/src/goat3dgfx.cc Sun Nov 24 14:00:14 2013 +0200 +++ b/src/goat3dgfx.cc Sun Nov 24 18:18:38 2013 +0200 @@ -1,17 +1,17 @@ #include "config.h" -#include "goat3dgfx.h" +#include "opengl.h" #include "vr.h" #include "logger.h" bool init_goat_graphics() { - log_info("initializing goat3d graphics\n"); + info_log("initializing goat3d graphics\n"); glewInit(); #ifdef USE_VR - if(vr_init() == -1) { - log_fatal("failed to initialize the VR system\n"); + if(vr_init(VR_INIT_OCULUS) == -1) { + fatal_log("failed to initialize the VR system\n"); return false; } #endif diff -r d061fe1a31ec -r 1868c5975f31 src/scene.cc --- a/src/scene.cc Sun Nov 24 14:00:14 2013 +0200 +++ b/src/scene.cc Sun Nov 24 18:18:38 2013 +0200 @@ -1,5 +1,6 @@ #include "scene.h" #include "opengl.h" +#include "goat3d.h" Scene::~Scene() { @@ -24,6 +25,31 @@ curves.clear(); } +bool Scene::load(const char *fname) +{ + goat3d *goat = goat3d_create(); + if(!goat) { + return false; + } + if(goat3d_load(goat, fname) == -1) { + return false; + } + + int num_meshes = goat3d_get_mesh_count(goat); + for(int i=0; i