diff options
| -rw-r--r-- | src/core.c | 6 | ||||
| -rw-r--r-- | src/raylib.h | 1 |
2 files changed, 7 insertions, 0 deletions
@@ -2669,6 +2669,12 @@ int GetRandomValue(int min, int max) return (rand()%(abs(max - min) + 1) + min); } +// Set the seed for the random number generator +void SetRandomSeed(unsigned int seed) +{ + srand(seed); +} + // Check if the file exists bool FileExists(const char *fileName) { diff --git a/src/raylib.h b/src/raylib.h index 3adc5c52..865d9d45 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1009,6 +1009,7 @@ RLAPI double GetTime(void); // Get elapsed // Misc. functions RLAPI int GetRandomValue(int min, int max); // Get a random value between min and max (both included) +RLAPI void SetRandomSeed(unsigned int seed); // Set the seed for the random number generator RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (filename extension defines format) RLAPI void SetConfigFlags(unsigned int flags); // Setup init configuration flags (view FLAGS) |
