From a273ea9a18d4c9d8cdb4db35f986a956fa1fef99 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Fri, 26 Dec 2014 11:16:08 -0500 Subject: [PATCH] Render*Rect NULL overloads --- src/SDL2.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index 6c0a7a4..9d31586 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -1973,6 +1973,15 @@ namespace SDL2 ref SDL_Rect rect ); + /* renderer refers to an SDL_Renderer*, rect to an SDL_Rect*. + * This overload allows for IntPtr.Zero (null) to be passed for rect. + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_RenderDrawRect( + IntPtr renderer, + IntPtr rect + ); + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderDrawRects( @@ -1989,6 +1998,15 @@ namespace SDL2 ref SDL_Rect rect ); + /* renderer refers to an SDL_Renderer*, rect to an SDL_Rect*. + * This overload allows for IntPtr.Zero (null) to be passed for rect. + */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_RenderFillRect( + IntPtr renderer, + IntPtr rect + ); + /* renderer refers to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_RenderFillRects(