X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fpolytest.c;h=bbc1c0b2932bf61ed9ad099eed4b2b379ff8ef95;hp=afe20069968f53a34c0ab917d0c859a529d38dbb;hb=7a0391a0519a4eb3438c8313841af01da5fa55ca;hpb=77e0277af0c00dae78c7a739b2ca70cc19fd041a diff --git a/src/polytest.c b/src/polytest.c index afe2006..bbc1c0b 100644 --- a/src/polytest.c +++ b/src/polytest.c @@ -16,6 +16,7 @@ static void destroy(void); static void start(long trans_time); static void draw(void); static void draw_lowres_raster(void); +static void keypress(int key); static int gen_texture(struct pimage *img, int xsz, int ysz); static struct screen scr = { @@ -24,7 +25,7 @@ static struct screen scr = { destroy, start, 0, draw, - 0 + keypress }; static float cam_theta, cam_phi = 25; @@ -202,6 +203,16 @@ static void draw_lowres_raster(void) } } +static void keypress(int key) +{ + switch(key) { + case 'b': + use_bsp = !use_bsp; + printf("drawing with %s\n", use_bsp ? "BSP tree" : "z-sorting"); + break; + } +} + static int gen_texture(struct pimage *img, int xsz, int ysz) { int i, j;