From e7f9b53796db044edd33d59805c0d002c8c8297c Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sun, 29 Sep 2013 05:45:58 -0400 Subject: [PATCH] Fix BlitSurface, add BlitSurfaceScaled --- src/SDL2.cs | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 88 insertions(+), 1 deletion(-) diff --git a/src/SDL2.cs b/src/SDL2.cs index 8977177..a4587c4 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -2585,7 +2585,7 @@ namespace SDL2 } /* src and dst refer to an SDL_Surface* */ - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_BlitSurface( IntPtr src, ref SDL_Rect srcrect, @@ -2593,6 +2593,93 @@ namespace SDL2 ref SDL_Rect dstrect ); + /* src and dst refer to an SDL_Surface* + * Internally, this function contains logic to use default values when + * source and destination rectangles are passed as NULL. + * This overload allows for IntPtr.Zero (null) to be passed for srcrect. + */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurface( + IntPtr src, + IntPtr srcrect, + IntPtr dst, + ref SDL_Rect dstrect + ); + + /* src and dst refer to an SDL_Surface* + * Internally, this function contains logic to use default values when + * source and destination rectangles are passed as NULL. + * This overload allows for IntPtr.Zero (null) to be passed for dstrect. + */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurface( + IntPtr src, + ref SDL_Rect srcrect, + IntPtr dst, + IntPtr dstrect + ); + + /* src and dst refer to an SDL_Surface* + * Internally, this function contains logic to use default values when + * source and destination rectangles are passed as NULL. + * This overload allows for IntPtr.Zero (null) to be passed for both SDL_Rects. + */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlit", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurface( + IntPtr src, + IntPtr srcrect, + IntPtr dst, + IntPtr dstrect + ); + + /* src and dst refer to an SDL_Surface* */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurfaceScaled( + IntPtr src, + ref SDL_Rect srcrect, + IntPtr dst, + ref SDL_Rect dstrect + ); + + /* src and dst refer to an SDL_Surface* + * Internally, this function contains logic to use default values when + * source and destination rectangles are passed as NULL. + * This overload allows for IntPtr.Zero (null) to be passed for srcrect. + */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurfaceScaled( + IntPtr src, + IntPtr srcrect, + IntPtr dst, + ref SDL_Rect dstrect + ); + + /* src and dst refer to an SDL_Surface* + * Internally, this function contains logic to use default values when + * source and destination rectangles are passed as NULL. + * This overload allows for IntPtr.Zero (null) to be passed for dstrect. + */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurfaceScaled( + IntPtr src, + ref SDL_Rect srcrect, + IntPtr dst, + IntPtr dstrect + ); + + /* src and dst refer to an SDL_Surface* + * Internally, this function contains logic to use default values when + * source and destination rectangles are passed as NULL. + * This overload allows for IntPtr.Zero (null) to be passed for both SDL_Rects. + */ + [DllImport(nativeLibName, EntryPoint = "SDL_UpperBlitScaled", CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_BlitSurfaceScaled( + IntPtr src, + IntPtr srcrect, + IntPtr dst, + IntPtr dstrect + ); + /* src and dst are void* pointers */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_ConvertPixels(