mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 10:25:31 +00:00
[Mac] CGDisplayBounds signature now matches Mac ABI
This resolves a crash in CGDisplayBounds when running through monokick.
This commit is contained in:
parent
ffb7bd8a4c
commit
cf3a30d024
|
@ -69,8 +69,20 @@ namespace OpenTK.Platform.MacOS.Carbon
|
||||||
[DllImport(appServices,EntryPoint="CGMainDisplayID")]
|
[DllImport(appServices,EntryPoint="CGMainDisplayID")]
|
||||||
internal static extern IntPtr MainDisplayID();
|
internal static extern IntPtr MainDisplayID();
|
||||||
|
|
||||||
|
// Note: sizeof(HIRect) == 16, which is larger than 8 bytes.
|
||||||
|
// The x86 and x64 Mac ABIs pass such structs as pointers in the
|
||||||
|
// first parameter slot. This is normally handled automatically
|
||||||
|
// by gcc/clang, but here we have to do it ourselves.
|
||||||
|
// See "Listing 4" on https://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html#//apple_ref/doc/uid/TP40002492-SW3
|
||||||
|
internal unsafe static HIRect DisplayBounds(IntPtr display)
|
||||||
|
{
|
||||||
|
HIRect rect;
|
||||||
|
DisplayBounds(out rect, display);
|
||||||
|
return rect;
|
||||||
|
}
|
||||||
|
|
||||||
[DllImport(appServices, EntryPoint = "CGDisplayBounds")]
|
[DllImport(appServices, EntryPoint = "CGDisplayBounds")]
|
||||||
internal unsafe static extern HIRect DisplayBounds(IntPtr display);
|
unsafe static extern void DisplayBounds(out HIRect rect, IntPtr display);
|
||||||
|
|
||||||
[DllImport(appServices,EntryPoint="CGDisplayPixelsWide")]
|
[DllImport(appServices,EntryPoint="CGDisplayPixelsWide")]
|
||||||
internal static extern int DisplayPixelsWide(IntPtr display);
|
internal static extern int DisplayPixelsWide(IntPtr display);
|
||||||
|
|
Loading…
Reference in a new issue