projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
load exhibits fails because loading is async
[laserbrain_demo]
/
src
/
app.cc
diff --git
a/src/app.cc
b/src/app.cc
index
1cf21bd
..
60affa0
100644
(file)
--- a/
src/app.cc
+++ b/
src/app.cc
@@
-14,6
+14,7
@@
#include "opt.h"
#include "post.h"
#include "renderer.h"
#include "opt.h"
#include "post.h"
#include "renderer.h"
+#include "exman.h"
#include "blob_exhibit.h"
#define NEAR_CLIP 5.0
#include "blob_exhibit.h"
#define NEAR_CLIP 5.0
@@
-61,6
+62,7
@@
static unsigned int sdr_post_gamma;
static long prev_msec;
static long prev_msec;
+static ExhibitManager *exman;
static BlobExhibit *blobs;
static bool show_blobs;
static BlobExhibit *blobs;
static bool show_blobs;
@@
-119,6
+121,11
@@
bool app_init(int argc, char **argv)
dir.y = 0;
cam_theta = rad_to_deg(acos(dot(dir, Vec3(0, 0, 1))));
dir.y = 0;
cam_theta = rad_to_deg(acos(dot(dir, Vec3(0, 0, 1))));
+ exman = new ExhibitManager;
+ if(!exman->load(mscn, "data/exhibits")) {
+ return false;
+ }
+
blobs = new BlobExhibit;
blobs->node = new SceneNode;
blobs->init();
blobs = new BlobExhibit;
blobs->node = new SceneNode;
blobs->init();
@@
-126,6
+133,8
@@
bool app_init(int argc, char **argv)
blobs->node->set_scaling(Vec3(28, 28, 28));
blobs->node->update(0);
blobs->node->set_scaling(Vec3(28, 28, 28));
blobs->node->update(0);
+ exman->add(blobs);
+
if(!(sdr_ltmap_notex = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-notex.p.glsl"))) {
return false;
}
if(!(sdr_ltmap_notex = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-notex.p.glsl"))) {
return false;
}
@@
-162,9
+171,7
@@
void app_cleanup()
delete rend;
delete rend;
- blobs->destroy();
- delete blobs->node;
- delete blobs;
+ delete exman;
texman.clear();
sceneman.clear();
texman.clear();
sceneman.clear();
@@
-194,9
+201,7
@@
static void update(float dt)
sceneman.update();
mscn->update(dt);
sceneman.update();
mscn->update(dt);
- if(show_blobs) {
- blobs->update(dt);
- }
+ exman->update(dt);
float speed = walk_speed * dt;
Vec3 dir;
float speed = walk_speed * dt;
Vec3 dir;