mirror of
https://github.com/Ryujinx/SDL2-CS.git
synced 2024-12-23 08:05:37 +00:00
Fix SDL_CreateColorCursor and SDL_LoadBMP
This commit is contained in:
parent
e22aa09e4d
commit
129410c745
21
src/SDL2.cs
21
src/SDL2.cs
|
@ -1964,16 +1964,25 @@ namespace SDL2
|
|||
ref byte g,
|
||||
ref byte b
|
||||
);
|
||||
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_LoadBMP")]
|
||||
private static extern IntPtr INTERNAL_SDL_LoadBMP(
|
||||
|
||||
/* These are for SDL_LoadBMP, which is a macro in the SDL headers */
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_LoadBMP_RW")]
|
||||
private static extern IntPtr INTERNAL_SDL_LoadBMP_RW(
|
||||
IntPtr src,
|
||||
int freesrc
|
||||
);
|
||||
[DllImport(nativeLibName, EntryPoint = "SDL_RWFromFile")]
|
||||
private static extern IntPtr INTERNAL_SDL_RWFromFile(
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string file
|
||||
string file,
|
||||
[InAttribute()] [MarshalAsAttribute(UnmanagedType.LPStr)]
|
||||
string mode
|
||||
);
|
||||
public static SDL_Surface SDL_LoadBMP(string file)
|
||||
{
|
||||
SDL_Surface result;
|
||||
IntPtr result_ptr = INTERNAL_SDL_LoadBMP(file);
|
||||
IntPtr rwops = INTERNAL_SDL_RWFromFile(file, "rb");
|
||||
IntPtr result_ptr = INTERNAL_SDL_LoadBMP_RW(rwops, 1);
|
||||
result = (SDL_Surface) Marshal.PtrToStructure(
|
||||
result_ptr,
|
||||
result.GetType()
|
||||
|
@ -3273,7 +3282,7 @@ namespace SDL2
|
|||
/* return value is an SDL_Cursor pointer */
|
||||
[DllImport(nativeLibName)]
|
||||
public static extern IntPtr SDL_CreateColorCursor(
|
||||
SDL_Surface surface,
|
||||
ref SDL_Surface surface,
|
||||
int hot_x,
|
||||
int hot_y
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue