A simple, fast, cross-platform random number generator.
More...
Detailed Description
A simple, fast, cross-platform random number generator.
The following code snippet creates a Plank RNG object, generates a random float, then destroys the Plank RNG object.
Typedef Documentation
An opaque reference to the Plank RNG object.
Function Documentation
Create a Plank RNG object and return an oqaque reference to it.
- Returns:
- A Plank RNG object as an opaque reference or NULL.
Create and initialise a Plank RNG object and return an oqaque reference to it.
- Returns:
- A Plank RNG object as an opaque reference or NULL.
Deinitialse a Plank RNG object.
- Parameters:
-
- Returns:
- A result code which will be PlankResult_OK if the operation was completely successful.
Destroy a Plank RNG object.
- Parameters:
-
- Returns:
- A result code which will be PlankResult_OK if the operation was completely successful.
Initialse a Plank RNG object.
- Parameters:
-
- Returns:
- A result code which will be PlankResult_OK if the operation was completely successful.
Generate a random integer.
- Parameters:
-
- Returns:
- The random integer.
static double pl_RNG_NextDouble |
( |
PlankRNGRef |
p | ) |
[static] |
Generate a random double between 0 and 1.
- Parameters:
-
- Returns:
- The random double.
static float pl_RNG_NextFloat |
( |
PlankRNGRef |
p | ) |
[static] |
Generate a random float between 0 and 1.
- Parameters:
-
- Returns:
- The random float.
static unsigned int pl_RNG_NextInt |
( |
PlankRNGRef |
p, |
|
|
unsigned int |
max |
|
) |
| [static] |
Generate a random unsigned integer over a given range.
- Parameters:
-
p | The Plank RNG object. |
max | Random numbers between 0 and max-1 will be generated. |
- Returns:
- The random unsigned integer.
Seed a Plank RNG object.
- Parameters:
-
p | The Plank RNG object. |
seed | The new seed. |