From 34d66997f0160f0d8fea49686070a60e2bf61103 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 16 Jul 2014 10:23:25 -0400 Subject: [PATCH] Finish SDL_timer.h --- src/SDL2.cs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/SDL2.cs b/src/SDL2.cs index 04c7977..789158d 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -5413,7 +5413,7 @@ namespace SDL2 #endregion - #region SDL_systimer.h + #region SDL_timer.h /* System timers rely on different OS mechanisms depending on * which operating system SDL2 is compiled against. @@ -5435,6 +5435,29 @@ namespace SDL2 [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern UInt32 SDL_GetTicks(); + /* Get the current value of the high resolution counter */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt64 SDL_GetPerformanceCounter(); + + /* Get the count per second of the high resolution counter */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern UInt64 SDL_GetPerformanceFrequency(); + + /* param refers to a void* */ + public delegate UInt32 SDL_TimerCallback(UInt32 interval, IntPtr param); + + /* int refers to an SDL_TimerID, param to a void* */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_AddTimer( + UInt32 interval, + SDL_TimerCallback callback, + IntPtr param + ); + + /* id refers to an SDL_TimerID */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern SDL_bool SDL_RemoveTimer(int id); + #endregion #region SDL_syswm.h