Initialize() public abstract method

Subclasses should initialize the underlying input subsystem using this method.
public abstract Initialize ( Axiom.Graphics.RenderWindow parent, bool useKeyboard, bool useMouse, bool useGamepad, bool ownMouse ) : void
parent Axiom.Graphics.RenderWindow Parent window that the input belongs to.
useKeyboard bool
useMouse bool
useGamepad bool
ownMouse bool /// If true, input will be taken over from the OS and exclusive to the window. /// If false, input will still be shared with other apps. ///
return void
コード例 #1
0
ファイル: Game.cs プロジェクト: Azerothian/Illisian.Niva
		public void OnLoad()
		{
			//ResourceGroupManager.Instance.AddResourceLocation("media", "Folder", true);

			_root.SceneManager = _sceneManager = _root.CreateSceneManager(SceneType.ExteriorClose);
			_sceneManager.ClearScene();

			_camera = _sceneManager.CreateCamera("MainCamera");

			_camera.Position = new Vector3(0, 0, 500);
			_camera.LookAt(new Vector3(0, 0, -300));
			_camera.Near = 5;
			_camera.AutoAspectRatio = true;
			_camera.FieldOfView = 0.70f;
			_viewport = _renderWindow.AddViewport(_camera, 0, 0, 1.0f, 1.0f, 100);
			_viewport.BackgroundColor = ColorEx.Black; ;

			_light = _sceneManager.CreateLight("light1");
			_light.Type = LightType.Directional;
			_light.Position = new Vector3(0, 150, 300);
			_light.Diffuse = ColorEx.Blue;
			_light.Specular = ColorEx.Blue;
			//_light.Direction = new Vector3(0, 0, -300);
			_sceneManager.AmbientLight = ColorEx.White;// new ColorEx(0.2f, 0.2f, 0.2f);

			ResourceGroupManager.Instance.InitializeAllResourceGroups();


			_inputReader = PlatformManager.Instance.CreateInputReader();
			_inputReader.Initialize(_renderWindow, true, true, false, false);

			_inputReader.UseKeyboardEvents = true;
			_inputReader.UseMouseEvents = false;

			//_renderItems.Add(new BasicCube());
			_renderItems.Add(new CubeBrowser());
			foreach (var i in _renderItems)
			{
				i.Initialise(_root);
			}
		}
コード例 #2
0
        protected virtual bool Setup()
        {
            // instantiate the Root singleton
            engine = new Root("EngineConfig.xml", "AxiomEngine.log");

            // add event handlers for frame events
            engine.FrameStarted += new FrameEvent(OnFrameStarted);
            engine.FrameEnded += new FrameEvent(OnFrameEnded);

            // allow for setting up resource gathering
            SetupResources();

            //show the config dialog and collect options
            if(!Configure()) {
                // shutting right back down
                engine.Shutdown();

                return false;
            }

            ChooseSceneManager();
            CreateCamera();
            CreateViewports();

            // set default mipmap level
            TextureManager.Instance.DefaultNumMipMaps = 5;

            // call the overridden CreateScene method
            CreateScene();

            // retreive and initialize the input system
            input = PlatformManager.Instance.CreateInputReader();
            input.Initialize(window, true, true, false, false, false);

            return true;
        }