public static DeviceInfo[] EnumerateDevices() { WrapperArray csa = OpenNI_enumerateDevices(); IntPtr[] array = new IntPtr[csa.Size]; Marshal.Copy(csa.Data, array, 0, csa.Size); DeviceInfo[] arrayObjects = new DeviceInfo[csa.Size]; for (int i = 0; i < csa.Size; i++) { arrayObjects[i] = new DeviceInfo(array[i]); } OpenNI_destroyDevicesArray(csa); return(arrayObjects); }
public VideoMode[] getSupportedVideoModes() { WrapperArray csa = SensorInfo_getSupportedVideoModes(this.Handle); IntPtr[] array = new IntPtr[csa.Size]; Marshal.Copy(csa.Data, array, 0, csa.Size); VideoMode[] arrayObjects = new VideoMode[csa.Size]; for (int i = 0; i < csa.Size; i++) { arrayObjects[i] = new VideoMode(array[i], true); } SensorInfo_destroyVideoModesArray(csa); return(arrayObjects); }
private static extern IntPtr SensorInfo_destroyVideoModesArray(WrapperArray array);
private static extern IntPtr OpenNI_destroyDevicesArray(WrapperArray array);