Updated SDL2
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -19,8 +19,8 @@
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_timer_h
|
||||
#define _SDL_timer_h
|
||||
#ifndef SDL_timer_h_
|
||||
#define SDL_timer_h_
|
||||
|
||||
/**
|
||||
* \file SDL_timer.h
|
||||
@@ -44,6 +44,17 @@ extern "C" {
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
|
||||
|
||||
/**
|
||||
* \brief Compare SDL ticks values, and return true if A has passed B
|
||||
*
|
||||
* e.g. if you want to wait 100 ms, you could do this:
|
||||
* Uint32 timeout = SDL_GetTicks() + 100;
|
||||
* while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
|
||||
* ... do work until timeout has elapsed
|
||||
* }
|
||||
*/
|
||||
#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
|
||||
|
||||
/**
|
||||
* \brief Get the current value of the high resolution counter
|
||||
*/
|
||||
@@ -77,7 +88,7 @@ typedef int SDL_TimerID;
|
||||
/**
|
||||
* \brief Add a new timer to the pool of timers already running.
|
||||
*
|
||||
* \return A timer ID, or NULL when an error occurs.
|
||||
* \return A timer ID, or 0 when an error occurs.
|
||||
*/
|
||||
extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
|
||||
SDL_TimerCallback callback,
|
||||
@@ -99,6 +110,6 @@ extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
|
||||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_timer_h */
|
||||
#endif /* SDL_timer_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
||||
Reference in New Issue
Block a user