示例#1
0
        /// <summary>
        /// Creates the individual input devices. I only create a keyboard and mouse
        /// here because they are the most common, but you can override this method
        /// for other modes and devices.
        /// </summary>
        protected virtual void CreateInputDevices()
        {
#if !(XBOX || XBOX360)
            this.Keyboard = this.InputManager.CreateInputObject <SIS.Keyboard>(true, String.Empty);
            this.Mouse    = this.InputManager.CreateInputObject <SIS.Mouse>(true, String.Empty);

            this.Keyboard.EventListener = this;
            this.Mouse.EventListener    = this;
#endif
        }
示例#2
0
文件: Sample.cs 项目: bostich83/axiom
        /// <summary>
        /// Sets up a sample. Used by the SampleContext class. Do not call directly.
        /// </summary>
        /// <param name="window"></param>
        /// <param name="keyboard"></param>
        /// <param name="mouse"></param>
        protected internal virtual void Setup(RenderWindow window, SIS.Keyboard keyboard, SIS.Mouse mouse)
        {
            this.Window   = window;
            this.Keyboard = keyboard;
            this.Mouse    = mouse;

            LocateResources();
            CreateSceneManager();
            SetupView();
            LoadResources();
            this.ResourcesLoaded = true;
            SetupContent();
            this.ContentSetup = true;

            this._done = false;
        }
示例#3
0
        /// <summary>
        /// Extendeded to setup a default tray interface and camera controller.
        /// </summary>
        /// <param name="window"></param>
        /// <param name="keyboard"></param>
        /// <param name="mouse"></param>
        protected internal override void Setup(RenderWindow window, SIS.Keyboard keyboard, SIS.Mouse mouse)
        {
            Window   = window;
            Keyboard = keyboard;
            Mouse    = mouse;

            LocateResources();
            CreateSceneManager();
            SetupView();

            this.TrayManager = new SdkTrayManager("SampleControls", window, mouse, this as ISdkTrayListener);
            // create a tray interface

            LoadResources();
            ResourcesLoaded = true;

            // Show stats and logo and Hide the cursor
            this.TrayManager.ShowFrameStats(TrayLocation.BottomLeft);
            this.TrayManager.ShowLogo(TrayLocation.BottomRight);
            this.TrayManager.HideCursor();

            // create a params panel for displaying sample details
            var items = new List <string>
            {
                "cam.pX",
                "cam.pY",
                "cam.pZ",
                String.Empty,
                "cam.oW",
                "cam.oX",
                "cam.oY",
                "cam.oZ",
                String.Empty,
                "Filtering",
                "Poly Mode"
            };

            this.DetailsPanel = this.TrayManager.CreateParamsPanel(TrayLocation.None, "DetailsPanel", 180, items);
            this.DetailsPanel.SetParamValue(9, "Bilinear");
            this.DetailsPanel.SetParamValue(10, "Solid");
            this.DetailsPanel.Hide();

            SetupContent();
            ContentSetup = true;

            IsDone = false;
        }
示例#4
0
        public override void Initialize()
        {
            ParameterList args = new ParameterList();

            args.Add(new Parameter("WINDOW", this.Game.Window.Handle));
#if !( WINDOWS_PHONE )
            args.Add(new Parameter("w32_mouse_hide", true));
#endif
            _inputManager = SIS.InputManager.CreateInputSystem(typeof(SIS.Xna.XnaInputManagerFactory), args);

            //log.Info( String.Format( "SIS Version : {0}", _inputManager.Version ) );
            //log.Info( String.Format( "Platform : {0}", _inputManager.InputSystemName ) );
            //log.Info( String.Format( "Number of Mice : {0}", _inputManager.DeviceCount<SIS.Mouse>() ) );
            //log.Info( String.Format( "Number of Keyboards : {0}", _inputManager.DeviceCount<SIS.Keyboard>() ) );
            //log.Info( String.Format( "Number of GamePads: {0}", _inputManager.DeviceCount<SIS.Joystick>() ) );

            bool buffered = false;

            if (_inputManager.DeviceCount <SIS.Keyboard>() > 0)
            {
                _kb = _inputManager.CreateInputObject <SIS.Keyboard>(buffered, "");
                //log.Info( String.Format( "Created {0}buffered keyboard", buffered ? "" : "un" ) );
            }
            else
            {
                _kb = new NullKeyboard();
            }

            if (_inputManager.DeviceCount <SIS.Mouse>() > 0)
            {
                _m = _inputManager.CreateInputObject <SIS.Mouse>(buffered, "");
                //log.Info( String.Format( "Created {0}buffered mouse", buffered ? "" : "un" ) );
                ////_m.EventListener = _handler;

                //MouseState ms = _m.MouseState;
                //ms.Width = 100;
                //ms.Height = 100;
            }
            else
            {
                _m = new NullMouse();
            }

            ////This demo only uses at max 4 joys
            int numSticks = _inputManager.DeviceCount <SIS.Joystick>();
            if (numSticks > 4)
            {
                numSticks = 4;
            }

            for (int i = 0; i < numSticks; ++i)
            {
                _joys.Insert(i, _inputManager.CreateInputObject <SIS.Joystick>(true, ""));
                //_joys[ i ].EventListener = _handler;

                _ff.Insert(i, (SIS.ForceFeedback)_joys[i].QueryInterface <SIS.ForceFeedback>());
                if (_ff[i] != null)
                {
                    //log.Info( String.Format( "Created buffered joystick with ForceFeedback support." ) );
                    //Dump out all the supported effects:
                    //        const ForceFeedback::SupportedEffectList &list = g_ff[i]->getSupportedEffects();
                    //        ForceFeedback::SupportedEffectList::const_iterator i = list.begin(),
                    //            e = list.end();
                    //        for( ; i != e; ++i)
                    //            std::cout << "Force =  " << i->first << " Type = " << i->second << std::endl;
                }
                //else
                //log.Info( String.Format( "Created buffered joystick. **without** FF support" ) );
            }
            base.Initialize();
        }
示例#5
0
		/// <summary>
		/// Creates the individual input devices. I only create a keyboard and mouse
		/// here because they are the most common, but you can override this method
		/// for other modes and devices.
		/// </summary>
		protected virtual void CreateInputDevices()
		{
#if !(XBOX || XBOX360 )
			this.Keyboard = this.InputManager.CreateInputObject<SIS.Keyboard>( true, String.Empty );
			this.Mouse = this.InputManager.CreateInputObject<SIS.Mouse>( true, String.Empty );

			this.Keyboard.EventListener = this;
			this.Mouse.EventListener = this;
#endif
		}