Kohi Game Engine
mtwister.h
Go to the documentation of this file.
1 
11 #include "defines.h"
12 
13 #define STATE_VECTOR_LENGTH 624
14 // NOTE: Changes to STATE_VECTOR_LENGTH requires a change to this as well.
15 #define STATE_VECTOR_M 397
16 
17 typedef struct mtrand_state {
21 
28 
35 
This file contains global type definitions which are used throughout the entire engine and applicatio...
#define KAPI
Import/export qualifier.
Definition: defines.h:205
double f64
64-bit floating point number
Definition: defines.h:50
signed int i32
Signed 32-bit integer.
Definition: defines.h:39
unsigned long long u64
Unsigned 64-bit integer.
Definition: defines.h:28
KAPI mtrand_state mtrand_create(u64 seed)
Creates a new Mersenne Twister random number generator using the provided seed.
KAPI f64 mtrand_generate_d(mtrand_state *generator)
Generates a new random 64-bit floating-point number from the given generator.
struct mtrand_state mtrand_state
KAPI u64 mtrand_generate(mtrand_state *generator)
Generates a new random 64-bit unsigned integer from the given generator.
#define STATE_VECTOR_LENGTH
Definition: mtwister.h:13
Definition: mtwister.h:17
i32 index
Definition: mtwister.h:19
u64 mt[STATE_VECTOR_LENGTH]
Definition: mtwister.h:18