Added some public RWops entry points.

This commit is contained in:
Ethan Lee 2014-03-07 11:02:24 -05:00
parent 404c4d583d
commit 21ab9a5d69
2 changed files with 26 additions and 1 deletions

View file

@ -64,7 +64,7 @@ namespace SDL2
#region SDL_rwops.h #region SDL_rwops.h
/* Note about SDL2# and RWops: /* Note about SDL2# and Internal RWops:
* These functions are currently not supported for public use. * These functions are currently not supported for public use.
* They are only meant to be used internally in functions marked with * They are only meant to be used internally in functions marked with
* the phrase "THIS IS AN RWops FUNCTION!" * the phrase "THIS IS AN RWops FUNCTION!"
@ -84,6 +84,14 @@ namespace SDL2
string mode 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 #endregion
#region SDL_main.h #region SDL_main.h

View file

@ -94,6 +94,14 @@ namespace SDL2
string file 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* */ /* IntPtr refers to an SDL_Texture*, renderer to an SDL_Renderer* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr IMG_LoadTexture( public static extern IntPtr IMG_LoadTexture(
@ -120,6 +128,15 @@ namespace SDL2
string file 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 #endregion
} }
} }