X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FLorenz%2Florenz.c;h=f2de979259e72fc6b524c14dbefbf58e6a5a35da;hb=22331701e4f069a5e222465ea7c95aa3a584821f;hp=f422b946b1c5c824712017fdf36cbe522a2c6427;hpb=4e261743ea8a805bc32089ae412dac422670d406;p=freeglut diff --git a/progs/demos/Lorenz/lorenz.c b/progs/demos/Lorenz/lorenz.c index f422b94..f2de979 100644 --- a/progs/demos/Lorenz/lorenz.c +++ b/progs/demos/Lorenz/lorenz.c @@ -31,8 +31,11 @@ #include #include #include -#include #include +#ifdef WIN32 +/* DUMP MEMORY LEAKS */ +#include +#endif /************************************** Defined Constants ***************************************/ @@ -138,15 +141,15 @@ void key_cb ( unsigned char key, int x, int y ) break ; case 'm' : case 'M' : /* Modify the Lorenz parameters */ - printf ( "Please enter new value for (default %lf, currently %lf): ", s0, sigma ) ; + printf ( "Please enter new value for (default %f, currently %f): ", s0, sigma ) ; fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ; sscanf ( inputline, "%lf", &sigma ) ; - printf ( "Please enter new value for (default %lf, currently %lf): ", b0, b ) ; + printf ( "Please enter new value for (default %f, currently %f): ", b0, b ) ; fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ; sscanf ( inputline, "%lf", &b ) ; - printf ( "Please enter new value for (default %lf, currently %lf): ", r0, r ) ; + printf ( "Please enter new value for (default %f, currently %f): ", r0, r ) ; fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ; sscanf ( inputline, "%lf", &r ) ; @@ -254,9 +257,9 @@ void display_cb ( void ) /* Print the distance between the two points */ glColor3d ( 1.0, 1.0, 1.0 ) ; /* White */ - sprintf ( string, "Distance: %10.6lf", distance ) ; + sprintf ( string, "Distance: %10.6f", distance ) ; glRasterPos2i ( 10, 10 ) ; - glutBitmapString ( GLUT_BITMAP_HELVETICA_12, string ) ; + glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)string ) ; glutSwapBuffers(); } @@ -343,6 +346,11 @@ int main ( int argc, char *argv[] ) /* Enter the GLUT main loop */ glutMainLoop () ; +#ifdef WIN32 + /* DUMP MEMORY LEAK INFORMATION */ + _CrtDumpMemoryLeaks () ; +#endif + return 0 ; }