logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_srand - Seeds the pseudo-random number generator.

Availability

       This function is available since SDL 3.2.0.

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 ().

Header File

       Defined in SDL3/SDL_stdinc.h

Name

       SDL_srand - Seeds the pseudo-random number generator.

See Also

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

Simple Directmedia Layer                           SDL 3.2.10                                       SDL_srand(3)

Synopsis

#include"SDL3/SDL.h"voidSDL_srand(Uint64seed);

Thread Safety

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

See Also