Esempio n. 1
0
        public void Run()
        {
            using (Graphics = GraphicsLibraryManager.GetGraphics(this))
            {
                if (Graphics == null)
                {
                    return;
                }

                Graphics.Initialize();
                Graphics.CullingEnabled = true;

                Input    = new Input(Graphics.Form);
                FreeLook = new FreeLook(Input);

                InitializePhysics();
                if (_isDebugDrawEnabled)
                {
                    InitializeDebugDrawer();
                }

                Graphics.UpdateView();
                SetInfoText();

                Graphics.Run();
            }
            Graphics = null;

            UninitializeDebugDrawer();
            UninitializePhysics();
        }
Esempio n. 2
0
        public void Run()
        {
            using (Graphics = GraphicsLibraryManager.GetGraphics(this))
            {
                Input    = new Input(Graphics.Form);
                Freelook = new FreeLook(Input);

                Graphics.Initialize();
                Graphics.CullingEnabled = isCullingEnabled;
                OnInitialize();

                if (World == null)
                {
                    OnInitializePhysics();
                    BulletExampleRunner.Get().PostOnInitializePhysics();
                }

                if (_isDebugDrawEnabled)
                {
                    if (_debugDrawer == null)
                    {
                        _debugDrawer           = Graphics.GetPhysicsDebugDrawer();
                        _debugDrawer.DebugMode = DebugDrawMode;
                    }
                    if (World != null)
                    {
                        World.DebugDrawer = _debugDrawer;
                    }
                }

                Graphics.UpdateView();

                clock.Start();

                Graphics.Run();

                /*
                 * if (_debugDrawer != null)
                 * {
                 * if (World != null)
                 * {
                 * World.DebugDrawer = null;
                 * }
                 * if (_debugDrawer is IDisposable)
                 * {
                 * (_debugDrawer as IDisposable).Dispose();
                 * }
                 * _debugDrawer = null;
                 * }
                 */
            }
            //Graphics = null;
        }
Esempio n. 3
0
        public void Run()
        {
            using (Graphics = GraphicsLibraryManager.GetGraphics(this))
            {
                Input    = new Input(Graphics.Form);
                Freelook = new FreeLook(Input);

                _bodyPicker = new BodyPicker(this);

                Graphics.Initialize();
                Graphics.CullingEnabled = isCullingEnabled;
                OnInitialize();
                if (World == null)
                {
                    OnInitializePhysics();
                }
                if (_isDebugDrawEnabled)
                {
                    if (_debugDrawer == null)
                    {
                        _debugDrawer           = Graphics.GetPhysicsDebugDrawer();
                        _debugDrawer.DebugMode = DebugDrawMode;
                    }
                    if (World != null)
                    {
                        World.DebugDrawer = _debugDrawer;
                    }
                }
                Graphics.UpdateView();
                SetInfoText();

                Graphics.Run();

                if (_debugDrawer != null)
                {
                    if (World != null)
                    {
                        World.DebugDrawer = null;
                    }
                    if (_debugDrawer is IDisposable)
                    {
                        (_debugDrawer as IDisposable).Dispose();
                    }
                    _debugDrawer = null;
                }
            }
            Graphics = null;
        }