SDL_image 2.0.2

pull/119/head
Ethan Lee 2017-11-18 20:50:56 -05:00
parent 14ef9e4643
commit 63aeac09ca
2 changed files with 37 additions and 3 deletions

View File

@ -137,9 +137,17 @@ namespace SDL2
* functions marked with the phrase "THIS IS A PUBLIC RWops FUNCTION!"
*/
/* IntPtr refers to an SDL_RWops* */
/* mem refers to a void*, IntPtr to an SDL_RWops* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr SDL_RWFromMem(byte[] mem, int size);
public static extern IntPtr SDL_RWFromMem(IntPtr mem, int size);
/* context refers to an SDL_RWops* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
internal static extern long SDL_RWtell(IntPtr context);
/* context refers to an SDL_RWops* */
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
internal static extern int SDL_RWclose(IntPtr context);
#endregion

View File

@ -50,7 +50,7 @@ namespace SDL2
*/
public const int SDL_IMAGE_MAJOR_VERSION = 2;
public const int SDL_IMAGE_MINOR_VERSION = 0;
public const int SDL_IMAGE_PATCHLEVEL = 0;
public const int SDL_IMAGE_PATCHLEVEL = 2;
[Flags]
public enum IMG_InitFlags
@ -212,6 +212,32 @@ namespace SDL2
int freedst
);
/* surface refers to an SDL_Surface* */
[DllImport(nativeLibName, EntryPoint = "IMG_SaveJPG", CallingConvention = CallingConvention.Cdecl)]
private static extern int INTERNAL_IMG_SaveJPG(
IntPtr surface,
byte[] file,
int quality
);
public static int IMG_SaveJPG(IntPtr surface, string file, int quality)
{
return INTERNAL_IMG_SaveJPG(
surface,
SDL.UTF8_ToNative(file),
quality
);
}
/* 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_SaveJPG_RW(
IntPtr surface,
IntPtr dst,
int freedst,
int quality
);
#endregion
}
}