Add calling convention attributes to unmanaged function pointers.
This commit is contained in:
parent
8e8c86b2c1
commit
50c37e58fc
@ -12,18 +12,23 @@ namespace ReFuel.Stb
|
||||
/// <param name="buffer">C array to read into.</param>
|
||||
/// <param name="count">Size of the C array in bytes.</param>
|
||||
/// <returns>The number of bytes read from the stream.</returns>
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int StbiReadProc(void *userdata, byte* buffer, int count);
|
||||
|
||||
/// <summary>
|
||||
/// Pointer to STBI stream skip function.
|
||||
/// </summary>
|
||||
/// <param name="userdata">User provided userdata pointer.</param>
|
||||
/// <param name="count">Number of bytes to skip.</param>
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void StbiSkipProc(void *userdata, int count);
|
||||
|
||||
/// <summary>
|
||||
/// Pointer to STBI stream end of file function.
|
||||
/// </summary>
|
||||
/// <param name="userdata">User provided userdata pointer.</param>
|
||||
/// <returns>Non-zero value if the end of the stream has been reached.</returns>
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate int StbiEofProc(void *userdata);
|
||||
|
||||
/// <summary>
|
||||
@ -123,4 +128,4 @@ namespace ReFuel.Stb
|
||||
|
||||
public static implicit operator IntPtr(in StbiWriteStreamWrapper wrapper) => wrapper.Callback;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ namespace ReFuel.Stb.Native
|
||||
/// <param name="context">User provided context pointer.</param>
|
||||
/// <param name="data">C Array of data to write.</param>
|
||||
/// <param name="size">Size of the C array in bytes.</param>
|
||||
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
|
||||
public unsafe delegate void StbiWriteProc(void* context, void* data, int size);
|
||||
|
||||
public unsafe partial class Stbi
|
||||
@ -24,7 +25,7 @@ namespace ReFuel.Stb.Native
|
||||
}
|
||||
|
||||
public static int write_png_compression_level
|
||||
{
|
||||
{
|
||||
get => *_png_compression_level_ptr;
|
||||
set => *_png_compression_level_ptr = value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user