3 * Routines to handle random number generation and hide platform differences.
6 // Written by Curtis Olson, started July 1997.
8 // Copyright (C) 1997 Curtis L. Olson - http://www.flightgear.org/~curt
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Library General Public
12 // License as published by the Free Software Foundation; either
13 // version 2 of the License, or (at your option) any later version.
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Library General Public License for more details.
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
37 * Seed the random number generater with time() so we don't see the
38 * same sequence every time.
40 void sg_srandom_time();
43 * Seed the random number generater with time() in 10 minute intervals
44 * so we get the same sequence within 10 minutes interval.
45 * This is useful for synchronizing two display systems.
47 void sg_srandom_time_10();
50 * Seed the random number generater with your own seed so can set up
51 * repeatable randomization.
52 * @param seed random number generator seed
54 void sg_srandom( unsigned int seed );
57 * Return a random number between [0.0, 1.0)
58 * @return next "random" number in the "random" sequence
68 #endif // _SG_RANDOM_H