示例#1
0
        public TestApp()
        {
            this.GraphicsDeviceManager = new GraphicsDeviceManager(this)
            {
#if PHONE
                PreferredBackBufferWidth       = 480,
                PreferredBackBufferHeight      = 800,
#else
                PreferredBackBufferWidth = 1280   ,
                PreferredBackBufferHeight = 720,
#endif
                PreferredBackBufferFormat      = SurfaceFormat.Color,
                SynchronizeWithVerticalRetrace = true,
            };


            Content.RootDirectory = "Content";

            base.IsFixedTimeStep = false;
            this.UpdateTimer = new Stopwatch();
            this.RenderTimer = new Stopwatch();

            input = new InputComponent(this);
            Components.Add(input);

            demos = new ParticleEffectGameComponent[] {new Demo2(this), new Demo1(this)};
            demoIndex = 1;
            for (int i = 0; i < demos.Length; i++)
            {
                var demo = demos[i];
                demo.Enabled = demo.Visible = (i == demoIndex);
                Components.Add(demo);
            }
        }
示例#2
0
        public TestApp()
        {
            this.GraphicsDeviceManager = new GraphicsDeviceManager(this)
            {
#if PHONE
                PreferredBackBufferWidth  = 480,
                PreferredBackBufferHeight = 800,
#else
                PreferredBackBufferWidth  = 1280,
                PreferredBackBufferHeight = 720,
#endif
                PreferredBackBufferFormat      = SurfaceFormat.Color,
                SynchronizeWithVerticalRetrace = true,
            };


            Content.RootDirectory = "Content";

            base.IsFixedTimeStep = false;
            this.UpdateTimer     = new Stopwatch();
            this.RenderTimer     = new Stopwatch();

            input = new InputComponent(this);
            Components.Add(input);

            demos     = new ParticleEffectGameComponent[] { new Demo2(this), new Demo1(this) };
            demoIndex = 1;
            for (int i = 0; i < demos.Length; i++)
            {
                var demo = demos[i];
                demo.Enabled = demo.Visible = (i == demoIndex);
                Components.Add(demo);
            }
        }