Exemple #1
0
        public static void RunLoop()
        {
            while (IsExist is true)
            {
                //update time
                Time.Update();

                SystemScene?.Update(Time.DeltaSeconds);
                MainScene?.Update(Time.DeltaSeconds);

                BehaviorSystems.ForEach((system) => UpdateBehaviorSystem(system));

                if (EngineWindow != null && EngineWindow.IsExisted != false)
                {
                    EngineWindow.Update(Time.DeltaSeconds);
                }

                if (EngineWindow != null && EngineWindow.IsExisted == false)
                {
                    IsExist = false;
                }

                PresentRender.BeginDraw();
                BehaviorSystems.ForEach((system) => system.Present(PresentRender));
                PresentRender.EndDraw(false);
            }
        }
Exemple #2
0
        public static void RunLoop()
        {
            while (IsExist is true)
            {
                //update time
                Time.Update();

                if (EngineWindow != null && EngineWindow.IsExisted != false)
                {
                    EngineWindow.Update(Time.DeltaSeconds);
                }

                if (EngineWindow != null && EngineWindow.IsExisted == false)
                {
                    IsExist = false;
                }

                //update time
                InputListener.Update();
                Gui.Update(Time.DeltaSeconds);

                //draw time
                Gui.Draw();

                //present time
                PresentRender.BeginDraw();

                Gui.Present(PresentRender);

                PresentRender.EndDraw(false);

                InputListener.Clear();
            }
        }