/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { world = new World(); player1 = new Player(world); player1Renderer = new PlayerRenderer(GraphicsDevice, player1); player1Renderer.Initialize(); hud = new HudRenderer(GraphicsDevice, world, player1Renderer.camera); hud.Initialize(); #region choose renderer renderer = new ThreadedWorldRenderer(GraphicsDevice, player1Renderer.camera, world); // renderer = new SimpleRenderer(GraphicsDevice, player1Renderer.camera, world,player1); diagnosticWorldRenderer = new DiagnosticWorldRenderer(GraphicsDevice, player1Renderer.camera, world); skyDomeRenderer = new SkyDomeRenderer(GraphicsDevice, player1Renderer.camera, world); renderer.Initialize(); diagnosticWorldRenderer.Initialize(); skyDomeRenderer.Initialize(); throwExceptions = false; #endregion //TODO refactor WorldRenderer needs player position + view frustum base.Initialize(); }
public override void Initialize(GraphicsDevice GraphicsDevice) { this.Graphics = GraphicsDevice; GameController.Reset(); #if DESKTOP God = new GodManager(GameController, MapRenderer); // Run god console on separate thread new Task(God.Initialize).Start(); #endif MapRenderer.Initialize(GraphicsDevice); HUD.Initialize(GraphicsDevice); GameController.Initialize(); }