Beispiel #1
0
        public Engine(ContentManager content, ScreenManager screenManager)
        {
            this.ScreenManager = screenManager;

            components = new List<Component>();
            componentsToBeAdded = new List<Component>();
            componentsToBeRemoved = new List<Component>();

            Content = content;

            Audio = new Audio(this);
            Input = new InputState();
            Physics = new Physics(this);
            Video = new Video(this);

            // these things require video
            Camera = new Camera2D(this);

            // lighting needs to know the camera matrix
            Lighting = new Lighting(this);

            SpriteBatch = new SpriteBatch(Global.GraphicsDeviceManager.GraphicsDevice);

            BloomComponent = new BloomComponent(this);
            BloomComponent.DrawOrder = int.MaxValue;
            BloomComponent.LoadContent();

            Updating = false;
        }
Beispiel #2
0
        public NePlusGame()
        {
            // tried to move this code, but it seems that nothing will draw unless it is located here
            // I seriously can't believe how many times this has come up
            graphics = new GraphicsDeviceManager(this);
            Global.Initialize(this, graphics);
            graphics.PreferredBackBufferWidth = Global.Configuration.GetIntConfig("Video", "Width");
            graphics.PreferredBackBufferHeight = Global.Configuration.GetIntConfig("Video", "Height");

            screenManager = new ScreenManager(this);
            Components.Add(screenManager);

            screenManager.AddScreen(new BackgroundScreen(), null);
            screenManager.AddScreen(new MainMenuScreen(), null);
        }