From 552a8b5ead12fb3ba70a46809b1f19c29d9b3e38 Mon Sep 17 00:00:00 2001 From: Justin Skiles Date: Mon, 2 Sep 2013 15:18:11 -0400 Subject: [PATCH] Adding overload for SDL_LockTexture to allow IntPtr.Zero in the "rect" parameter. SDL documentation states that passing NULL for this value will lock the entire texture." --- src/SDL2.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/SDL2.cs b/src/SDL2.cs index f43965b..2bf6c35 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -1658,6 +1658,23 @@ namespace SDL2 out byte b ); + /* texture refers to an SDL_Texture*, pixels to a void* */ + /// + /// Use this function to lock a portion of the texture for write-only pixel access. + /// + /// + /// + /// + /// + /// + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int SDL_LockTexture( + IntPtr texture, + ref SDL_Rect rect, + out IntPtr pixels, + out int pitch + ); + /* texture refers to an SDL_Texture*, pixels to a void* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int SDL_LockTexture(