dbf-halloween2015

annotate src/rng.h @ 3:c37fe5d8a4ed

windows port
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 01 Nov 2015 06:04:28 +0200
parents
children
rev   line source
nuclear@0 1 #ifndef RNG_H_
nuclear@0 2 #define RNG_H_
nuclear@0 3
nuclear@0 4 #include <stdint.h>
nuclear@0 5
nuclear@0 6 struct RandGenState;
nuclear@0 7
nuclear@0 8 class RandGen {
nuclear@0 9 private:
nuclear@0 10 RandGenState *state;
nuclear@0 11
nuclear@0 12 RandGen(const RandGen&);
nuclear@0 13 RandGen &operator =(const RandGen&);
nuclear@0 14
nuclear@0 15 public:
nuclear@0 16 RandGen();
nuclear@0 17 ~RandGen();
nuclear@0 18
nuclear@0 19 void seed(uint32_t s);
nuclear@0 20
nuclear@0 21 uint32_t generate();
nuclear@0 22 float generate_float();
nuclear@0 23 };
nuclear@0 24
nuclear@0 25 void rng_srand(uint32_t s);
nuclear@0 26 uint32_t rng_rand();
nuclear@0 27 float rng_frand();
nuclear@0 28
nuclear@0 29
nuclear@0 30 #endif // RNG_H_