Skip to content

Commit

Permalink
Publicly expose RWops functions
Browse files Browse the repository at this point in the history
  • Loading branch information
TSRBerry authored and flibitijibibo committed Jan 3, 2023
1 parent 1634e5a commit f8c6fc4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/SDL2.cs
Expand Up @@ -4674,15 +4674,15 @@ uint color
/* These are for SDL_LoadBMP, which is a macro in the SDL headers. */
/* IntPtr refers to an SDL_Surface* */
/* THIS IS AN RWops FUNCTION! */
[DllImport(nativeLibName, EntryPoint = "SDL_LoadBMP_RW", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr INTERNAL_SDL_LoadBMP_RW(
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr SDL_LoadBMP_RW(
IntPtr src,
int freesrc
);
public static IntPtr SDL_LoadBMP(string file)
{
IntPtr rwops = SDL_RWFromFile(file, "rb");
return INTERNAL_SDL_LoadBMP_RW(rwops, 1);
return SDL_LoadBMP_RW(rwops, 1);
}

/* surface refers to an SDL_Surface* */
Expand Down Expand Up @@ -4710,16 +4710,16 @@ public static IntPtr SDL_LoadBMP(string file)
/* These are for SDL_SaveBMP, which is a macro in the SDL headers. */
/* IntPtr refers to an SDL_Surface* */
/* THIS IS AN RWops FUNCTION! */
[DllImport(nativeLibName, EntryPoint = "SDL_SaveBMP_RW", CallingConvention = CallingConvention.Cdecl)]
private static extern int INTERNAL_SDL_SaveBMP_RW(
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int SDL_SaveBMP_RW(
IntPtr surface,
IntPtr src,
int freesrc
);
public static int SDL_SaveBMP(IntPtr surface, string file)
{
IntPtr rwops = SDL_RWFromFile(file, "wb");
return INTERNAL_SDL_SaveBMP_RW(surface, rwops, 1);
return SDL_SaveBMP_RW(surface, rwops, 1);
}

/* surface refers to an SDL_Surface* */
Expand Down Expand Up @@ -8192,8 +8192,8 @@ public static string SDL_GetCurrentAudioDriver()

/* audio_buf refers to a malloc()'d buffer, IntPtr to an SDL_AudioSpec* */
/* THIS IS AN RWops FUNCTION! */
[DllImport(nativeLibName, EntryPoint = "SDL_LoadWAV_RW", CallingConvention = CallingConvention.Cdecl)]
private static extern IntPtr INTERNAL_SDL_LoadWAV_RW(
[DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr SDL_LoadWAV_RW(
IntPtr src,
int freesrc,
out SDL_AudioSpec spec,
Expand All @@ -8207,7 +8207,7 @@ public static string SDL_GetCurrentAudioDriver()
out uint audio_len
) {
IntPtr rwops = SDL_RWFromFile(file, "rb");
return INTERNAL_SDL_LoadWAV_RW(
return SDL_LoadWAV_RW(
rwops,
1,
out spec,
Expand Down

0 comments on commit f8c6fc4

Please sign in to comment.