protected virtual void Update(GameTime gameTime) { #if BASIC_PROFILER updateStart = gameTimer.ElapsedTicks; #endif lock (updateableComponents) { for (int i = 0; i < updateableComponents.Count; i += 1) { currentlyUpdatingComponents.Add(updateableComponents[i]); } } foreach (IUpdateable updateable in currentlyUpdatingComponents) { if (updateable.Enabled) { updateable.Update(gameTime); } } currentlyUpdatingComponents.Clear(); FrameworkDispatcher.Update(); #if BASIC_PROFILER updateTime = gameTimer.ElapsedTicks - updateStart; #endif }
public Game() { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; LaunchParameters = new LaunchParameters(); Components = new GameComponentCollection(); Services = new GameServiceContainer(); updateableComponents = new List <IUpdateable>(); currentlyUpdatingComponents = new List <IUpdateable>(); drawableComponents = new List <IDrawable>(); currentlyDrawingComponents = new List <IDrawable>(); IsMouseVisible = false; IsFixedTimeStep = true; TargetElapsedTime = TimeSpan.FromTicks(166667); // 60fps InactiveSleepTime = TimeSpan.FromSeconds(0.02); hasInitialized = false; suppressDraw = false; isDisposed = false; gameTime = new GameTime(); Window = FNAPlatform.CreateWindow(); Mouse.WindowHandle = Window.Handle; TouchPanel.WindowHandle = Window.Handle; FrameworkDispatcher.Update(); Content = new AssetManager(this, Services, AssetManager.GameDirectory); // Ready to run the loop! RunApplication = true; }
public Game() { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; LaunchParameters = new LaunchParameters(); Content = new ContentManager(); IsMouseVisible = false; IsFixedTimeStep = true; TargetElapsedTime = TimeSpan.FromTicks(166667); // 60fps InactiveSleepTime = TimeSpan.FromSeconds(0.02); textInputControlDown = new bool[FNAPlatform.TextInputCharacters.Length]; textInputControlRepeat = new int[FNAPlatform.TextInputCharacters.Length]; hasInitialized = false; suppressDraw = false; isDisposed = false; gameTime = new GameTime(); Window = FNAPlatform.CreateWindow(); Mouse.WindowHandle = Window.Handle; TouchPanel.WindowHandle = Window.Handle; FrameworkDispatcher.Update(); // Ready to run the loop! RunApplication = true; GraphicsDeviceManager.Instance = new GraphicsDeviceManager(this); }
protected virtual void Update(GameTime gameTime) { #if BASIC_PROFILER updateStart = _gameTimer.ElapsedTicks; #endif FrameworkDispatcher.Update(); _updateables.ForEachFilteredItem(UpdateAction, gameTime); #if BASIC_PROFILER updateTime = _gameTimer.ElapsedTicks - updateStart; #endif }
internal void DoUpdate(GameTime gameTime) { AssertNotDisposed(); if (Platform.BeforeUpdate(gameTime)) { FrameworkDispatcher.Update(); Update(gameTime); //The TouchPanel needs to know the time for when touches arrive TouchPanelState.CurrentTimestamp = gameTime.TotalGameTime; } }
public Game() { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; LaunchParameters = new LaunchParameters(); _services = new GameServiceContainer(); _components = new GameComponentCollection(); _content = new ContentManager(_services); Window = FNAPlatform.CreateWindow(); FrameworkDispatcher.Update(); // Ready to run the loop! RunApplication = true; }
protected virtual void Update(GameTime gameTime) { lock (updateableComponents) { for (int i = 0; i < updateableComponents.Count; i += 1) { currentlyUpdatingComponents.Add(updateableComponents[i]); } } foreach (IUpdateable updateable in currentlyUpdatingComponents) { if (updateable.Enabled) { updateable.Update(gameTime); } } currentlyUpdatingComponents.Clear(); FrameworkDispatcher.Update(); }
public Game() { _instance = this; LaunchParameters = new LaunchParameters(); _services = new GameServiceContainer(); _components = new GameComponentCollection(); _content = new ContentManager(_services); Platform = GamePlatform.PlatformCreate(this); Platform.Activated += OnActivated; Platform.Deactivated += OnDeactivated; _services.AddService(typeof(GamePlatform), Platform); // Calling Update() for first time initializes some systems FrameworkDispatcher.Update(); // Allow some optional per-platform construction to occur too. PlatformConstruct(); }
public Game() { AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; LaunchParameters = new LaunchParameters(); Components = new GameComponentCollection(); Services = new GameServiceContainer(); Content = new ContentManager(Services); updateableComponents = new List <IUpdateable>(); currentlyUpdatingComponents = new List <IUpdateable>(); drawableComponents = new List <IDrawable>(); currentlyDrawingComponents = new List <IDrawable>(); IsMouseVisible = false; IsFixedTimeStep = true; TargetElapsedTime = TimeSpan.FromTicks(166667); // 60fps InactiveSleepTime = TimeSpan.FromSeconds(0.02); for (int i = 0; i < previousSleepTimes.Length; i += 1) { previousSleepTimes[i] = TimeSpan.FromMilliseconds(1); } textInputControlDown = new bool[FNAPlatform.TextInputCharacters.Length]; textInputControlRepeat = new int[FNAPlatform.TextInputCharacters.Length]; hasInitialized = false; suppressDraw = false; isDisposed = false; gameTime = new GameTime(); Window = FNAPlatform.CreateWindow(); Mouse.WindowHandle = Window.Handle; TouchPanel.WindowHandle = Window.Handle; FrameworkDispatcher.Update(); // Ready to run the loop! RunApplication = true; }
public Game() { _instance = this; LaunchParameters = new LaunchParameters(); _services = new GameServiceContainer(); _components = new GameComponentCollection(); _content = new ContentManager(_services); Platform = GamePlatform.PlatformCreate(this); Platform.Activated += OnActivated; Platform.Deactivated += OnDeactivated; _services.AddService(typeof(GamePlatform), Platform); // Calling Update() for first time initializes some systems FrameworkDispatcher.Update(); #if WINDOWS_STOREAPP && !WINDOWS_PHONE81 Platform.ViewStateChanged += Platform_ApplicationViewChanged; #endif }
protected virtual void Update(GameTime gameTime) { FrameworkDispatcher.Update(); }