projects
/
demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
quick backup
[demo]
/
src
/
main.cc
diff --git
a/src/main.cc
b/src/main.cc
index
3c75e31
..
50eea41
100644
(file)
--- a/
src/main.cc
+++ b/
src/main.cc
@@
-3,11
+3,14
@@
#include <string.h>
#include <vector>
#include <string.h>
#include <vector>
+#include "global.h"
+
/* TODO: fix those */
#include "camera.h"
#include "mesh.h"
#include "object.h"
#include "scene.h"
/* TODO: fix those */
#include "camera.h"
#include "mesh.h"
#include "object.h"
#include "scene.h"
+#include "shader_manager.h"
#include "opengl/opengl.h"
#include "vulkan/vk.h"
#include "opengl/opengl.h"
#include "vulkan/vk.h"
@@
-31,6
+34,7
@@
int win_w = 800;
int win_h = 600;
OrbitCamera *camera;
int win_h = 600;
OrbitCamera *camera;
+ShaderManager *sdr_man;
/* variables */
static float phi = 25;
/* variables */
static float phi = 25;
@@
-94,6
+98,8
@@
static bool init()
return false;
}
return false;
}
+ sdr_man = new ShaderManager;
+
camera = new OrbitCamera;
camera->set_orbit_params(phi, theta, dist);
camera = new OrbitCamera;
camera->set_orbit_params(phi, theta, dist);
@@
-114,14
+120,15
@@
static bool init()
static void cleanup()
{
static void cleanup()
{
+ delete sdr_man;
+ delete camera;
+
if(use_vulkan) {
cleanup_vulkan();
}
else {
cleanup_opengl();
}
if(use_vulkan) {
cleanup_vulkan();
}
else {
cleanup_opengl();
}
-
- delete camera;
}
static void key_clbk(GLFWwindow *win, int key, int scancode, int action, int mods)
}
static void key_clbk(GLFWwindow *win, int key, int scancode, int action, int mods)
@@
-173,7
+180,6
@@
static void display()
}
else {
display_opengl();
}
else {
display_opengl();
- scene.objects[0]->mesh->update_vertex_data();
scene.objects[0]->mesh->draw();
}
}
\ No newline at end of file
scene.objects[0]->mesh->draw();
}
}
\ No newline at end of file