123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System;
- using System.Runtime.InteropServices;
- namespace GpuInterop;
- static class NativeMethods
- {
- [Flags]
- public enum IOSurfaceLockOptions : uint
- {
- None = 0,
- ReadOnly = 1 << 0,
- AvoidSync = 1 << 1,
- }
- [DllImport("/System/Library/Frameworks/IOSurface.framework/IOSurface")]
- public static extern int IOSurfaceLock(IntPtr surface, IOSurfaceLockOptions options, IntPtr seed);
- [DllImport("/System/Library/Frameworks/IOSurface.framework/IOSurface")]
- public static extern nint IOSurfaceGetWidth(IntPtr surface);
- [DllImport("/System/Library/Frameworks/IOSurface.framework/IOSurface")]
- public static extern nint IOSurfaceGetHeight(IntPtr surface);
- [DllImport("/System/Library/Frameworks/IOSurface.framework/IOSurface")]
- public static extern nint IOSurfaceGetBytesPerRow(IntPtr surface);
- [DllImport("/System/Library/Frameworks/IOSurface.framework/IOSurface")]
- public static extern IntPtr IOSurfaceGetBaseAddress(IntPtr surface);
- [DllImport("/System/Library/Frameworks/IOSurface.framework/IOSurface")]
- public static extern void IOSurfaceUnlock(IntPtr surface, IOSurfaceLockOptions options, IntPtr seed);
-
- [DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
- public static extern IntPtr CFRetain(IntPtr cf);
- [DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
- public static extern void CFRelease(IntPtr cf);
- [DllImport("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation")]
- public static extern nint CFGetRetainCount(IntPtr cf);
- }
|