Pseudo-random number generators. More...
Classes | |
struct | KzcRandom |
Structure for pseudo-random number generator. More... | |
Functions | |
kzsError | kzcRandomCreate (const struct KzcMemoryManager *memoryManager, kzS32 seed, struct KzcRandom **out_random) |
Creates a new pseudo random number generator with the given seed. More... | |
kzsError | kzcRandomCreateDefault (const struct KzcMemoryManager *memoryManager, struct KzcRandom **out_random) |
Creates a new pseudo random number generator with a seed based on current system time. More... | |
kzsError | kzcRandomDelete (struct KzcRandom *random) |
Frees the memory allocated for the given pseudo random number generator. More... | |
struct KzcRandom | kzcRandomInline (kzS32 seed) |
Returns a pseudo random number generator without allocating memory for it. More... | |
struct KzcRandom | kzcRandomInlineDefault (void) |
Returns a pseudo random number generator without allocating memory for it. More... | |
void | kzcRandomSetSeed (struct KzcRandom *random, kzS32 seed) |
Sets the random seed. More... | |
kzFloat | kzcRandomFloat (struct KzcRandom *random) |
Returns a random float in the range [0,1[. More... | |
kzInt | kzcRandomInteger (struct KzcRandom *random, kzInt min, kzInt max) |
Returns a random integer in the range [min,max[. More... | |
Pseudo-random number generators.
Copyright 2008-2017 by Rightware. All rights reserved.
kzsError kzcRandomCreate | ( | const struct KzcMemoryManager * | memoryManager, |
kzS32 | seed, | ||
struct KzcRandom ** | out_random | ||
) |
Creates a new pseudo random number generator with the given seed.
kzsError kzcRandomCreateDefault | ( | const struct KzcMemoryManager * | memoryManager, |
struct KzcRandom ** | out_random | ||
) |
Creates a new pseudo random number generator with a seed based on current system time.
Frees the memory allocated for the given pseudo random number generator.
Returns a pseudo random number generator without allocating memory for it.
Uses the given seed.
struct KzcRandom kzcRandomInlineDefault | ( | void | ) |
Returns a pseudo random number generator without allocating memory for it.
Uses a seed based on current system time.