示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Context"/> class.
        /// </summary>
        public Context()
        {
            object error;

            handle = NativeMethods.rs2_create_context(ApiVersion, out error);
            onDevicesChangedCallback = new rs2_devices_changed_callback(OnDevicesChangedInternal);
        }
示例#2
0
        /// <summary>
        /// default librealsense context class
        /// </summary>
        public Context()
        {
            object error;

            api_version = NativeMethods.rs2_get_api_version(out error);
            m_instance  = new HandleRef(this, NativeMethods.rs2_create_context(api_version, out error));

            onDevicesChangedCallback = new rs2_devices_changed_callback(onDevicesChanged);
            NativeMethods.rs2_set_devices_changed_callback(m_instance.Handle, onDevicesChangedCallback, IntPtr.Zero, out error);
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Context"/> class.
 /// </summary>
 public Context()
     : base(Create(), NativeMethods.rs2_delete_context)
 {
     onDevicesChangedCallback = new rs2_devices_changed_callback(OnDevicesChangedInternal);
 }