AForge.Video.Kinect.KinectNative.freenect_shutdown C# (CSharp) Method

freenect_shutdown() private method

private freenect_shutdown ( IntPtr context ) : int
context IntPtr
return int
        public static extern int freenect_shutdown( IntPtr context );

Usage Example

Example #1
0
        // Shuts down the context and closes any open devices
        public static void ShutdownContext( )
        {
            if (freenectContext != IntPtr.Zero)
            {
                // shutdown context
                int result = KinectNative.freenect_shutdown(freenectContext);
                if (result != 0)
                {
                    throw new ApplicationException("Could not shutdown freenect context. Error Code:" + result);
                }

                // Dispose pointer
                KinectNative.freenectContext = IntPtr.Zero;
            }
        }