Ejemplo n.º 1
0
        /// <summary>
        /// Called after the Game and GraphicsDevice are created, but before LoadContent.
        /// </summary>
        protected override void Initialize()
        {
            this.CalculatePixelAspectRatio();

            this.Window.Title = "Nyx";

#if LINUX
            // Avoids a bug in OpenTK where a non user resizable window is not programmatically resizable either. Without this line, the game window would always be the OpenTK default of 640x480.
            this.Window.AllowUserResizing = true;
#endif

            DeferredRenderer deferredRenderer = new DeferredRenderer(this);
            GameStateManager gameStateManager = new GameStateManager(this);
            InputService inputService = new InputService(this);

            // Push the initial gamestate on to the stack
            gameStateManager.PushGameState(this.initialGameState);

            Components.Add(deferredRenderer);
            Components.Add(gameStateManager);
            Components.Add(inputService);

            Services.AddService(typeof(DeferredRenderer), deferredRenderer);
            Services.AddService(typeof(GameStateManager), gameStateManager);
            Services.AddService(typeof(InputService), inputService);

            base.Initialize();
        }
Ejemplo n.º 2
0
 public RenderingComponent(DeferredRenderer deferredRenderer)
 {
     this.deferredRenderer = deferredRenderer;
 }
 public SpotLightRenderingComponent(DeferredRenderer deferredRenderer)
     : base(deferredRenderer)
 {
 }
 public DirectionalLightRenderingComponent(DeferredRenderer deferredRenderer)
     : base(deferredRenderer)
 {
 }