mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-03-20 15:51:07 +01:00
Added SDL_srand(), SDL_rand(), and SDL_rand_r() (thanks @JKaniarz!)
These are simple random functions that should not be used for serious random number generation. Fixes https://github.com/libsdl-org/SDL/issues/4968
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
|
||||
/* Simple program: draw a RGB triangle, with texture */
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "testutils.h"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <SDL3/SDL_main.h>
|
||||
@@ -21,9 +23,6 @@
|
||||
#include <emscripten/emscripten.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
static SDLTest_CommonState *state;
|
||||
static SDL_bool use_texture = SDL_FALSE;
|
||||
static SDL_Texture **sprites;
|
||||
@@ -260,8 +259,6 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
srand((unsigned int)time(NULL));
|
||||
|
||||
/* Main render loop */
|
||||
frames = 0;
|
||||
then = SDL_GetTicks();
|
||||
|
||||
Reference in New Issue
Block a user