From 07d4d8a4948b6ecd44c80a3da7afd58d36515a24 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Sat, 27 Dec 2014 22:14:52 -0500 Subject: [PATCH] A few SDL2_image RWops funcs --- src/SDL2_image.cs | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/SDL2_image.cs b/src/SDL2_image.cs index 13308b4..cac3cab 100644 --- a/src/SDL2_image.cs +++ b/src/SDL2_image.cs @@ -102,6 +102,16 @@ namespace SDL2 int freesrc ); + /* src refers to an SDL_RWops*, IntPtr to an SDL_Surface* */ + /* THIS IS A PUBLIC RWops FUNCTION! */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr IMG_LoadTyped_RW( + IntPtr src, + int freesrc, + [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] + string type + ); + /* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr IMG_LoadTexture( @@ -110,6 +120,32 @@ namespace SDL2 string file ); + /* renderer refers to an SDL_Renderer*. + * src refers to an SDL_RWops*. + * IntPtr to an SDL_Texture*. + */ + /* THIS IS A PUBLIC RWops FUNCTION! */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr IMG_LoadTexture_RW( + IntPtr renderer, + IntPtr src, + int freesrc + ); + + /* renderer refers to an SDL_Renderer*. + * src refers to an SDL_RWops*. + * IntPtr to an SDL_Texture*. + */ + /* THIS IS A PUBLIC RWops FUNCTION! */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr IMG_LoadTextureTyped_RW( + IntPtr renderer, + IntPtr src, + int freesrc, + [In()] [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(LPUtf8StrMarshaler))] + string type + ); + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern int IMG_InvertAlpha(int on);