examples/renderer/02-primitives: seed the RNG.

This commit is contained in:
Ryan C. Gordon 2024-09-24 13:54:53 -04:00
parent 95134f6d58
commit 62389ada6f
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 2 additions and 0 deletions

View File

@ -29,6 +29,8 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[])
return SDL_APP_FAILURE;
}
SDL_srand(0); /* seed the random number generator */
/* set up some random points */
for (i = 0; i < SDL_arraysize(points); i++) {
points[i].x = (SDL_randf() * 440.0f) + 100.0f;