Esempio n. 1
0
        /// <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()
        {
            Input = InputIterator();

            Random noiseRandom = new Random(0);

            noiseRandom.NextBytes(NoiseAlpha);
            noiseRandom.NextBytes(NoiseBeta);

            SpriteLoader.Init(GraphicsDevice);
            Scheduler.Init();

            RenderTarget2D pixel = new RenderTarget2D(GraphicsDevice, 1, 1);

            GraphicsDevice.SetRenderTarget(pixel);
            GraphicsDevice.Clear(Color.White);
            GraphicsDevice.SetRenderTarget(null);
            Pixel = pixel;

            LoadFont();

            SceneGame sceneGame = new SceneGame(this);

            Scene = sceneGame;

            base.Initialize();
        }
Esempio n. 2
0
 public static void Init(GraphicsDevice device)
 {
     Instance = new SpriteLoader(device);
 }