seed random number generator with PID and time

This commit is contained in:
Josh Holtrop 2011-01-13 13:40:09 -05:00
parent ecba9f2c88
commit 95868042f6

View File

@ -2,6 +2,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <math.h> #include <math.h>
#include <sys/types.h>
#include <unistd.h>
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
@ -13,7 +15,7 @@ Spin::Spin()
m_num_monitors = 1; m_num_monitors = 1;
m_monitor_info = new monitor_info_t[m_num_monitors]; m_monitor_info = new monitor_info_t[m_num_monitors];
m_last_ticks = 0; m_last_ticks = 0;
srand(time(NULL)); srand(time(NULL) + getpid());
initMonitorInfo(); initMonitorInfo();
} }