X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fscr%2Ftestb.c;h=eb494309bedbc49149b86db56116d01ac443f389;hb=628ef3345462458f2fb6be034583e61238b89f89;hp=548fa0ba17dd38b726839cbcf4645272fe715d2d;hpb=313480bbe9994a200ed9a4355d97a033bf0d6151;p=andemo diff --git a/src/scr/testb.c b/src/scr/testb.c index 548fa0b..eb49430 100644 --- a/src/scr/testb.c +++ b/src/scr/testb.c @@ -1,5 +1,6 @@ #include "demo.h" #include "noise.h" +#include "cgmath/cgmath.h" static int init(void); static void destroy(void); @@ -7,9 +8,10 @@ static void draw(void); static unsigned int sdr_foo; +static struct demoscreen scr = { "testb", init, destroy, 0, 0, 0, 0, draw }; + void regscr_testb(void) { - static struct demoscreen scr = { "testb", init, destroy, 0, 0, 0, 0, draw }; dsys_add_screen(&scr); } @@ -32,7 +34,8 @@ static void draw(void) { int i, j; float x, y, xr, yr, sz; - float t = dsys_time / 700.0f; + float t = dsys.tmsec / 700.0f; + float foo = dsys_value("testb.hueflash"); glUseProgram(sdr_foo); gl_begin(GL_QUADS); @@ -40,12 +43,13 @@ static void draw(void) y = (i + 0.5f) / (NY/2.0f) - 1.0f; for(j=0; j 1.0f) sz = 1.0f; xr = sz / NX; yr = sz / NY; + gl_color3f(1, cgm_lerp(1, 0.7, foo), cgm_lerp(1, 0.3, foo)); gl_vertex2f(x - xr, y - yr); gl_vertex2f(x + xr, y - yr); gl_vertex2f(x + xr, y + yr);