/*ARGUSED1*/ void key(unsigned char key, int x, int y) { switch(key) { case 'a': afunc(); break; case 'b': bfunc(); break; case 'h': help(); break; case 'm': mfunc(); break; case 's': sfunc(); break; case 't': tfunc(); break; case 'x': xfunc(); break; case '\033': exit(EXIT_SUCCESS); break; default: break; } glutPostRedisplay(); }
/*ARGSUSED1*/ void key(unsigned char key, int x, int y) { switch(key) { case 'l': light(); break; case 'f': ffunc(); break; case 'F': Ffunc(); break; case 't': toggle_t(); break; case 'm': mfunc(); break; case 'w': wire(); break; case 'x': xfunc(); break; case 'h': help(); break; case '\033': exit(EXIT_SUCCESS); break; default: help(); break; } glutPostRedisplay(); }
int mandelbrot ( _c c, int iter ) { _c x = {0.0, 0.0}; int k; double m; for ( k=0; k<iter; ++k ) { mfunc(x,c); m = sq_mod(x); if ( m>=4.0 ) { break; } } c_print(x); printf("m = %f (%d)\n",m,k); return k; }