mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 10:18:28 +00:00
Update the code for the iOS demos to handle modern devices. Fixes bug #3337
This commit is contained in:
parent
40ecac8e60
commit
a8b033d7c4
12 changed files with 233 additions and 143 deletions
|
@ -32,5 +32,25 @@ void
|
|||
fatalError(const char *string)
|
||||
{
|
||||
printf("%s: %s\n", string, SDL_GetError());
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, string, SDL_GetError(), NULL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static Uint64 prevTime = 0;
|
||||
|
||||
double
|
||||
updateDeltaTime()
|
||||
{
|
||||
Uint64 curTime;
|
||||
double deltaTime;
|
||||
|
||||
if (prevTime == 0) {
|
||||
prevTime = SDL_GetPerformanceCounter();
|
||||
}
|
||||
|
||||
curTime = SDL_GetPerformanceCounter();
|
||||
deltaTime = (double) (curTime - prevTime) / (double) SDL_GetPerformanceFrequency();
|
||||
prevTime = curTime;
|
||||
|
||||
return deltaTime;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue