Scroll to navigation

SDL_srand(3) SDL3 FUNCTIONS SDL_srand(3)

NAME

SDL_srand - Seeds the pseudo-random number generator.

HEADER FILE

Defined in SDL3/SDL_stdinc.h

SYNOPSIS

#include "SDL3/SDL.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

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.1.3.

SEE ALSO

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

SDL 3.1.6 Simple Directmedia Layer