Пример #1
0
        private void DetectInputDevices()
        {
            this.lastInputDeviceUpdate = Time.MainTimer.TotalSeconds;

            GlobalGamepadInputSource.UpdateAvailableDecives(DualityApp.Gamepads);
            GlobalJoystickInputSource.UpdateAvailableDecives(DualityApp.Joysticks);
        }
Пример #2
0
        protected override void InitPlugin()
        {
            base.InitPlugin();

            mainThread = Thread.CurrentThread;

            // Initialize OpenTK
            {
                bool           inEditor = DualityApp.ExecEnvironment == DualityApp.ExecutionEnvironment.Editor;
                ToolkitOptions options  = new ToolkitOptions
                {
                    // Prefer the native backend in the editor, because it supports GLControl. SDL doesn't.
                    Backend = inEditor ? PlatformBackend.PreferNative : PlatformBackend.Default,
                    // Disable High Resolution support in the editor, because it's not DPI-Aware
                    EnableHighResolution = !inEditor
                };
                Toolkit.Init(options);
            }

            // Register global / non-windowbound input devices
            GlobalGamepadInputSource.UpdateAvailableDecives(DualityApp.Gamepads);
            GlobalJoystickInputSource.UpdateAvailableDecives(DualityApp.Joysticks);
        }