SDL_srand - Man Page

Seeds the pseudo-random number generator.

Synopsis

#include <SDL3/SDL_stdinc.h>

void SDL_srand(Uint64 seed);

Description

Reusing the seed number will cause SDL_rand() to repeat the same stream of 'random' numbers.

Function Parameters

seed

the value to use as a random number seed, or 0 to use SDL_GetPerformanceCounter().

Thread Safety

This should be called on the same thread that calls SDL_rand()

Availability

This function is available since SDL 3.2.0.

See Also

SDL_rand(3), SDL_rand_bits(3), SDL_randf(3)

Referenced By

SDL_rand(3), SDL_rand_bits(3), SDL_randf(3).

SDL 3.2.16 Simple Directmedia Layer SDL3 FUNCTIONS