Example #1
0
        internal void Init(string[] args)
        {
            string[] newArgs = new string[args.Length + 1];
            newArgs[0] = "program";
            if (System.Reflection.Assembly.GetEntryAssembly() != null)
            {
                newArgs[0] = System.Reflection.Assembly.GetEntryAssembly().FullName;
            }

            Array.Copy(args, 0, newArgs, 1, args.Length);

            ctx = Cfunctions.Survive_init_internal(newArgs.Length, newArgs, IntPtr.Zero, log_func);

            if (ctx == IntPtr.Zero)
            {
                throw new Exception("There was a problem initializing the lib!");
            }

            light_Process_Func           = LightEvent;
            raw_Pose_Func                = PoseEvent;
            lighthouse_pose_process_func = LightHouseEvent;
            angle_Process_Func           = AngleEvent;
            button_Process_Func          = ButtonEvent;
            Config_Func      = ConfigEvent;
            imu_Process_Func = IMUEvent;
            log_func         = InfoEvent;

            Cfunctions.Survive_install_pose_fn(ctx, raw_Pose_Func);
            Cfunctions.Survive_install_light_fn(ctx, light_Process_Func);
            Cfunctions.Survive_install_lighthouse_pose_fn(ctx, lighthouse_pose_process_func);
            Cfunctions.Survive_install_angle_fn(ctx, angle_Process_Func);
            Cfunctions.Survive_install_button_fn(ctx, button_Process_Func);
            Cfunctions.Survive_install_config_fn(ctx, Config_Func);
            Cfunctions.Survive_install_imu_fn(ctx, imu_Process_Func);
        }
Example #2
0
 public static extern void Survive_install_log_fn(SurviveContextPtr ctx, log_process_func fbp);
Example #3
0
 public static extern SurviveContextPtr Survive_init_internal(int argc, string[] args, IntPtr user,
                                                              log_process_func fbp);