]> git.sesse.net Git - movit/blobdiff - demo.cpp
Allow data files to be fetched somewhere else than the current directory.
[movit] / demo.cpp
index 5bcfa4335a2670f1784878246bdc7f8460dd81c2..f5434cc1dd5d40f293bd9b9ec2d5c21534e9b812 100644 (file)
--- a/demo.cpp
+++ b/demo.cpp
@@ -14,6 +14,8 @@
 #include <vector>
 #include <map>
 
+#include <GL/glew.h>
+
 #include <SDL/SDL.h>
 #include <SDL/SDL_opengl.h>
 #include <SDL/SDL_image.h>
@@ -22,7 +24,6 @@
 #include "effect.h"
 #include "effect_chain.h"
 #include "util.h"
-#include "opengl.h"
 #include "widgets.h"
 
 #include "flat_input.h"
@@ -154,12 +155,12 @@ int main(int argc, char **argv)
        SDL_SetVideoMode(WIDTH, HEIGHT, 0, SDL_OPENGL);
        SDL_WM_SetCaption("OpenGL window", NULL);
 
-       init_movit();
+       init_movit(".");
        printf("GPU texture subpixel precision: about %.1f bits\n",
                log2(1.0f / movit_texel_subpixel_precision));
        
        unsigned img_w, img_h;
-       unsigned char *src_img = load_image("blg_wheels_woman_1.jpg", &img_w, &img_h);
+       unsigned char *src_img = load_image(argc > 1 ? argv[1] : "blg_wheels_woman_1.jpg", &img_w, &img_h);
 
        EffectChain chain(WIDTH, HEIGHT);
        glViewport(0, 0, WIDTH, HEIGHT);
@@ -178,6 +179,7 @@ int main(int argc, char **argv)
        //sandbox_effect->set_float("parm", 42.0f);
        //chain.add_effect(new MirrorEffect());
        chain.add_output(inout_format);
+       chain.set_dither_bits(8);
        chain.finalize();
 
        // generate a PBO to hold the data we read back with glReadPixels()