public static void CaptureSamples <T>(IntPtr device, ref T buffer, int samples) where T : struct { GCHandle gcHandle = GCHandle.Alloc((object)buffer, GCHandleType.Pinned); try { Alc.CaptureSamples(device, gcHandle.AddrOfPinnedObject(), samples); } finally { gcHandle.Free(); } }
public static void CaptureSamples <T>(IntPtr device, T[,,] buffer, int samples) where T : struct { Alc.CaptureSamples <T>(device, buffer.Address(0, 0, 0), samples); }
public static void CaptureSamples <T>(IntPtr device, T[] buffer, int samples) where T : struct { Alc.CaptureSamples <T>(device, ref buffer[0], samples); }