optionally source assets from URL
[laserbrain_demo] / src / app.cc
index 07ecdec..4c6559b 100644 (file)
@@ -2,6 +2,7 @@
 #include <limits.h>
 #include <assert.h>
 #include <goatvr.h>
+#include <assman.h>
 #include "app.h"
 #include "opengl.h"
 #include "sdr.h"
@@ -113,6 +114,11 @@ bool app_init(int argc, char **argv)
        app_resize(opt.width, opt.height);
        app_fullscreen(opt.fullscreen);
 
+       if(opt.data_url) {
+               info_log("Adding URL asset source: %s\n", opt.data_url);
+               ass_add_url("data", opt.data_url);
+       }
+
        if(opt.vr) {
                if(goatvr_init() == -1) {
                        return false;
@@ -559,6 +565,12 @@ void app_display()
                vp_width = win_width;
                vp_height = win_height;
 
+               if(!gfbo && !fb_srgb && sdr_post_gamma) {
+                       glViewport(0, 0, win_width, win_height);
+                       slow_post(sdr_post_gamma);
+                       glUseProgram(0);
+               }
+
                if(should_swap) {
                        app_swap_buffers();
                }