X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdemo.c;fp=src%2Fdemo.c;h=77c33d2617bd83942af450a2239dacb0204ecbfc;hb=313480bbe9994a200ed9a4355d97a033bf0d6151;hp=50232756f48fc1af6c96559936bee7e276e3effd;hpb=ef6f5c2822eb91ea7df55e88018f566be04ad287;p=andemo diff --git a/src/demo.c b/src/demo.c index 5023275..77c33d2 100644 --- a/src/demo.c +++ b/src/demo.c @@ -20,6 +20,7 @@ int demo_init(void) if(!(tex_logo = get_tex2d("data/ml_logo_old.png"))) { return -1; } + glBindTexture(GL_TEXTURE_2D, tex_logo); glUseProgram(sdr_foo); gl_begin(GL_QUADS); gl_texcoord2f(0, 1); @@ -47,18 +48,10 @@ void demo_cleanup(void) void demo_display(void) { - struct demoscreen *scr; + dsys_update(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - scr = dsys_act_scr; - while(scr) { - if(scr->update) { - scr->update(dsys_time); - } - scr->draw(); - scr = scr->next; - } + dsys_draw(); } void demo_reshape(int x, int y) @@ -102,12 +95,10 @@ void demo_keyboard(int key, int pressed) } } else { - struct demoscreen *scr = dsys_act_scr; - while(scr) { - if(scr->keyboard) { - scr->keyboard(key, pressed); - } - scr = scr->next; + int i; + for(i=0; ikeyboard) scr->keyboard(key, pressed); } } } @@ -115,22 +106,18 @@ void demo_keyboard(int key, int pressed) void demo_mouse(int bn, int pressed, int x, int y) { - struct demoscreen *scr = dsys_act_scr; - while(scr) { - if(scr->mouse) { - scr->mouse(bn, pressed, x, y); - } - scr = scr->next; + int i; + for(i=0; imouse) scr->mouse(bn, pressed, x, y); } } void demo_motion(int x, int y) { - struct demoscreen *scr = dsys_act_scr; - while(scr) { - if(scr->motion) { - scr->motion(x, y); - } - scr = scr->next; + int i; + for(i=0; imotion) scr->motion(x, y); } }