X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=demo_prior;a=blobdiff_plain;f=src%2Fpart_whitted.c;fp=src%2Fpart_whitted.c;h=bda876bd9457f8dfd029c7394a2bc12f3fb5c35f;hp=18bed8da04df346f8ef6a3a326e06b79e679b015;hb=8e783a58d1e21ace04fd6d7ed00158e65bd78040;hpb=2f14a35e7d557da12f24056267b911f24774aa18 diff --git a/src/part_whitted.c b/src/part_whitted.c index 18bed8d..bda876b 100644 --- a/src/part_whitted.c +++ b/src/part_whitted.c @@ -4,6 +4,7 @@ #include "sdr.h" #include "texture.h" #include "post.h" +#include "imtk.h" static int init(void); static void destroy(void); @@ -70,6 +71,9 @@ static void stop(void) static void draw(long tm) { + static float vgn_offset = 0.47; + static float vgn_sharp = 3.1; + glDisable(GL_DEPTH_TEST); glMatrixMode(GL_MODELVIEW); @@ -97,7 +101,7 @@ static void draw(long tm) glVertex2f(-1, 1); glEnd(); - vignette(0.43, 0.38, 0.45, 0.8, 1.0); + vignette(0.43, 0.38, 0.45, vgn_offset, vgn_sharp); if(dbgtex && dbg_alpha > 0.0) { glUseProgram(0); @@ -108,6 +112,25 @@ static void draw(long tm) glMatrixMode(GL_TEXTURE); glLoadIdentity(); } + + if(dbgui) { + glUseProgram(0); + + imtk_begin(); + imtk_layout_start(10, 20); + imtk_layout_spacing(10); + + imtk_layout_dir(IMTK_HORIZONTAL); + + imtk_label("offset:", IMTK_AUTO, IMTK_AUTO); + vgn_offset = imtk_slider(IMUID, vgn_offset, 0.0, 1.5, IMTK_AUTO, IMTK_AUTO); + imtk_layout_newline(); + + imtk_label("sharpness:", IMTK_AUTO, IMTK_AUTO); + vgn_sharp = imtk_slider(IMUID, vgn_sharp, 0, 10, IMTK_AUTO, IMTK_AUTO); + imtk_layout_newline(); + imtk_end(); + } } static void mbutton(int bn, int st, int x, int y) @@ -117,6 +140,11 @@ static void mbutton(int bn, int st, int x, int y) mouse_y = y; switch(bn) { + case 0: + if(imtk_layout_contains(x, y)) { + imtk_inp_mouse(bn, st); + } + break; case 3: dbg_alpha += 0.1; if(dbg_alpha > 1.0) dbg_alpha = 1.0; @@ -136,6 +164,11 @@ static void mmotion(int x, int y) if(!(dx | dy)) return; + if(imtk_layout_contains(x, y)) { + imtk_inp_motion(x, y); + return; + } + if(bnstate[0]) { cam_theta += dx * 0.5; cam_phi += dy * 0.5;