#include <math.h>
#include <time.h>
#include <GL/freeglut.h>
+#ifdef WIN32
+#include <crtdbg.h> // DUMP MEMORY LEAKS
+#endif
/************************************** Defined Constants ***************************************/
/* GLUT callbacks */
+#define INPUT_LINE_LENGTH 80
+
void key_cb ( unsigned char key, int x, int y )
{
int i ;
- char inputline [ 80 ] ;
+ char inputline [ INPUT_LINE_LENGTH ] ;
switch ( key )
{
case 'm' : case 'M' : /* Modify the Lorenz parameters */
printf ( "Please enter new value for <sigma> (default %lf, currently %lf): ", s0, sigma ) ;
- fgets ( inputline, 79, stdin ) ;
+ fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ;
sscanf ( inputline, "%lf", &sigma ) ;
printf ( "Please enter new value for <b> (default %lf, currently %lf): ", b0, b ) ;
- fgets ( inputline, 79, stdin ) ;
+ fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ;
sscanf ( inputline, "%lf", &b ) ;
printf ( "Please enter new value for <r> (default %lf, currently %lf): ", r0, r ) ;
- fgets ( inputline, 79, stdin ) ;
+ fgets ( inputline, INPUT_LINE_LENGTH-1, stdin ) ;
sscanf ( inputline, "%lf", &r ) ;
break ;
if ( updown == GLUT_DOWN )
{
double dist = 1.0e20 ; /* A very large number */
- (void) dist; /* what's this all about? */
+ dist = 0.0 ; /* so we don't get "unused variable" compiler warning */
+ /* The idea here is that we go into "pick" mode and pick the nearest point
+ to the mouse click position. Unfortunately I don't have the time to implement
+ it at the moment. */
}
}
srand ( 1023 ) ;
/* Set up the OpenGL parameters */
- /* glDrawBuffer ( GL_BACK ) ;*/
glEnable ( GL_DEPTH_TEST ) ;
glClearColor ( 0.0, 0.0, 0.0, 0.0 ) ;
glClearDepth ( 1.0 ) ;
/* Enter the GLUT main loop */
glutMainLoop () ;
- return 0;
+#ifdef WIN32
+ _CrtDumpMemoryLeaks () ; // DUMP MEMORY LEAK INFORMATION
+#endif
+
+ return 0 ;
}