projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added morphing to the cow
[demo]
/
src
/
main.cc
diff --git
a/src/main.cc
b/src/main.cc
index
d4d4226
..
1246d2f
100644
(file)
--- a/
src/main.cc
+++ b/
src/main.cc
@@
-13,8
+13,8
@@
/* TODO: fix those */
#include "camera.h"
#include "mesh.h"
/* TODO: fix those */
#include "camera.h"
#include "mesh.h"
+#include "morph_renderer.h"
#include "object.h"
#include "object.h"
-#include "renderer.h"
#include "scene.h"
#include "terrain.h"
#include "texture.h"
#include "scene.h"
#include "terrain.h"
#include "texture.h"
@@
-43,9
+43,10
@@
GLFWwindow *win;
int win_w = 800;
int win_h = 600;
int win_w = 800;
int win_h = 600;
-
ShaderManager *sdr_man;
ShaderManager *sdr_man;
+double time_sec;
+
/* variables */
static bool move_camera;
/* variables */
static bool move_camera;
@@
-59,7
+60,7
@@
static OrbitCamera *camera;
static Scene *cow_scene;
static Object *cow_object;
static Scene *cow_scene;
static Object *cow_object;
-static Renderer *cow_rend;
+static MorphRenderer *cow_rend;
static Terrain terrain;
static Texture *skybox_tex;
static Terrain terrain;
static Texture *skybox_tex;
@@
-128,7
+129,7
@@
static bool init(Gfx_API api)
return false;
}
return false;
}
- cow_rend = new Renderer;
+ cow_rend = new MorphRenderer;
cow_rend->camera = camera;
cow_rend->scene = cow_scene;
cow_rend->camera = camera;
cow_rend->scene = cow_scene;
@@
-299,9
+300,9
@@
static void update(float dt)
static void display()
{
static float prev_tsec;
static void display()
{
static float prev_tsec;
- float tsec = glfwGetTime();
- float dt = tsec - prev_tsec;
- prev_tsec = tsec;
+ time_sec = glfwGetTime();
+ float dt = time_sec - prev_tsec;
+ prev_tsec = time_sec;
update(dt);
update(dt);