8 static unsigned int sdr_foo;
9 static unsigned int tex_logo;
13 if(init_opengl() == -1) {
17 if(!(sdr_foo = get_sdrprog("sdr/foo.v.glsl", "sdr/foo.p.glsl"))) {
20 if(!(tex_logo = get_tex2d("data/ml_logo_old.png"))) {
23 glBindTexture(GL_TEXTURE_2D, tex_logo);
24 glUseProgram(sdr_foo);
37 if(dsys_init("data/demoscript") == -1) {
44 void demo_cleanup(void)
49 void demo_display(void)
53 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
56 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
58 glBindTexture(GL_TEXTURE_2D, tex_logo);
59 glUseProgram(sdr_foo);
61 gl_color4f(1, 1, 1, dsys_value("flashlogo"));
76 void demo_reshape(int x, int y)
80 glViewport(0, 0, x, y);
82 for(i=0; i<dsys.num_screens; i++) {
83 if(dsys.screens[i]->reshape) {
84 dsys.screens[i]->reshape(x, y);
89 void demo_keyboard(int key, int pressed)
107 if(key >= '0' && key <= '9') {
108 dsys_seek_rel((float)(key - '0') / 9.0f);
110 } else if(key >= KEY_F1 && key <= KEY_F12) {
111 int idx = key - KEY_F1;
112 if(idx < dsys.num_screens) {
113 dsys_run_screen(dsys.screens[idx]);
118 for(i=0; i<dsys.num_act; i++) {
119 struct demoscreen *scr = dsys.act[i];
120 if(scr->keyboard) scr->keyboard(key, pressed);
126 void demo_mouse(int bn, int pressed, int x, int y)
129 for(i=0; i<dsys.num_act; i++) {
130 struct demoscreen *scr = dsys.act[i];
131 if(scr->mouse) scr->mouse(bn, pressed, x, y);
135 void demo_motion(int x, int y)
138 for(i=0; i<dsys.num_act; i++) {
139 struct demoscreen *scr = dsys.act[i];
140 if(scr->motion) scr->motion(x, y);