mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2025-01-22 09:01:00 +00:00
SDL_image 2.0.2
This commit is contained in:
parent
14ef9e4643
commit
63aeac09ca
12
src/SDL2.cs
12
src/SDL2.cs
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue