diff --git a/src/SDL2.cs b/src/SDL2.cs index 70614ee..3c42fb5 100644 --- a/src/SDL2.cs +++ b/src/SDL2.cs @@ -64,7 +64,7 @@ namespace SDL2 #region SDL_rwops.h - /* Note about SDL2# and RWops: + /* Note about SDL2# and Internal RWops: * These functions are currently not supported for public use. * They are only meant to be used internally in functions marked with * the phrase "THIS IS AN RWops FUNCTION!" @@ -84,6 +84,14 @@ namespace SDL2 string mode ); + /* These are the public RWops functions. They should be used by + * functions marked with the phrase "THIS IS A PUBLIC RWops FUNCTION!" + */ + + /* IntPtr refers to an SDL_RWops */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr SDL_RWFromMem(byte[] mem, int size); + #endregion #region SDL_main.h diff --git a/src/SDL2_image.cs b/src/SDL2_image.cs index 90d09af..13308b4 100644 --- a/src/SDL2_image.cs +++ b/src/SDL2_image.cs @@ -94,6 +94,14 @@ namespace SDL2 string file ); + /* 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_Load_RW( + IntPtr src, + int freesrc + ); + /* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */ [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr IMG_LoadTexture( @@ -120,6 +128,15 @@ namespace SDL2 string file ); + /* surface refers to an SDL_Surface*, dst to an SDL_RWops* */ + /* THIS IS A PUBLIC RWops FUNCTION! */ + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern int IMG_SavePNG_RW( + IntPtr surface, + IntPtr dst, + int freedst + ); + #endregion } }