]> git.sesse.net Git - movit/blobdiff - demo.cpp
Make combine_two_pixels() handle the fact that the GPU has limited subpixel interpola...
[movit] / demo.cpp
index 552380a9cf971ac984c43ebbf77708ea58bdefb2..2243f2dd702b90419ef491963636c6508c76b669 100644 (file)
--- a/demo.cpp
+++ b/demo.cpp
@@ -18,6 +18,7 @@
 #include <SDL/SDL_opengl.h>
 #include <SDL/SDL_image.h>
 
 #include <SDL/SDL_opengl.h>
 #include <SDL/SDL_image.h>
 
+#include "init.h"
 #include "effect.h"
 #include "effect_chain.h"
 #include "util.h"
 #include "effect.h"
 #include "effect_chain.h"
 #include "util.h"
@@ -152,14 +153,16 @@ int main(int argc, char **argv)
        SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
        SDL_SetVideoMode(WIDTH, HEIGHT, 0, SDL_OPENGL);
        SDL_WM_SetCaption("OpenGL window", NULL);
        SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
        SDL_SetVideoMode(WIDTH, HEIGHT, 0, SDL_OPENGL);
        SDL_WM_SetCaption("OpenGL window", NULL);
-       
-       // geez 
-       glPixelStorei(GL_PACK_ALIGNMENT, 1);
 
 
+       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);
 
        EffectChain chain(WIDTH, HEIGHT);
        unsigned img_w, img_h;
        unsigned char *src_img = load_image("blg_wheels_woman_1.jpg", &img_w, &img_h);
 
        EffectChain chain(WIDTH, HEIGHT);
+       glViewport(0, 0, WIDTH, HEIGHT);
 
        ImageFormat inout_format;
        inout_format.color_space = COLORSPACE_sRGB;
 
        ImageFormat inout_format;
        inout_format.color_space = COLORSPACE_sRGB;