/// <summary> /// Core framework constructor. /// </summary> public FrameworkCore() : base() { game = this; graphicsDeviceManager = new GraphicsDeviceManager(this); viewer = new Viewer(this); inputManager = new InputComponentManager(); fontManager = new FontManager(); screenManager = new GameScreenManager(this); textManager = new TextManager(this); resourceManager = new ResourceManager(this, "Content"); particleManager = new ParticleManager(); collisionContext = new CollisionContext(); soundManager = new SoundManager(); gameEventManager = new GameEventManager(); fpsCounter = new FpsCounter(); // Entry GameScreenManager AddComponent(screenManager); // Disable vertical retrace to get highest framerates possible for // testing performance. //graphicsDeviceManager.SynchronizeWithVerticalRetrace = false; // Update as fast as possible, do not use fixed time steps IsFixedTimeStep = false; }
/// <summary> /// Dispose all managers. /// </summary> protected override void Dispose(bool disposing) { if (fpsCounter != null) { fpsCounter = null; } if (textManager != null) { textManager.Dispose(); textManager = null; } if (fontManager != null) { fontManager.Dispose(); fontManager = null; } inputManager = null; if (collisionContext != null) { collisionContext.ClearAllLayer(); collisionContext = null; } if (particleManager != null) { particleManager.ClearAllParticles(); particleManager = null; } if (soundManager != null) { soundManager.Dispose(); soundManager = null; } if (screenManager != null) { screenManager.Dispose(); screenManager = null; } if (viewer != null) { viewer.Dispose(); viewer = null; } if (resourceManager != null) { resourceManager.Dispose(); resourceManager = null; } if (debugFont != null) debugFont = null; base.Dispose(disposing); }
/// <summary> /// Constructor. /// </summary> protected BaseStageScreen() { TransitionOnTime = TimeSpan.FromSeconds(5.0f); TransitionOffTime = TimeSpan.FromSeconds(2.0f); this.refScene3DRoot = FrameworkCore.Scene3DRoot; this.refViewer = FrameworkCore.Viewer; this.refRenderContext = FrameworkCore.RenderContext; this.refGraphicsDevice = FrameworkCore.Game.GraphicsDevice; this.refCollisionContext = FrameworkCore.CollisionContext; this.refParticleManager = FrameworkCore.ParticleManager; this.gameLevel = new GameLevel(); this.playerOldLife = new int[2]; this.playerReduceArmorElapsedTime = new float[2]; this.pickupMessageElapsedTime = new float[2]; this.playerReduceArmorElapsedTime = new float[2]; this.missionResultElapsedTime = 0.0f; }