Esempio n. 1
0
        public override void Intro( params object [] args )
        {
            Core.GraphicsDevice.ImmediateContext.BlendState = BlendState.AlphaBlend;

            Add ( InputHelper.Instance );
            Add ( calc = new FpsCalculator () );

            contentManager = new ResourceTable ( FileSystemManager.GetFileSystem ( "ManifestFileSystem" ) );
            Texture2DContentLoader.AddDefaultDecoders ();

            textures = new ITexture2D [ 6 ];
            textures [ 0 ] = contentManager.Load<ITexture2D> ( "Resources/PerformanceTest/0096x0096.tga" );
            textures [ 1 ] = contentManager.Load<ITexture2D> ( "Resources/PerformanceTest/0128x0128.png" );
            textures [ 2 ] = contentManager.Load<ITexture2D> ( "Resources/PerformanceTest/0256x0256.png" );
            textures [ 3 ] = contentManager.Load<ITexture2D> ( "Resources/PerformanceTest/0512x0512.png" );
            textures [ 4 ] = contentManager.Load<ITexture2D> ( "Resources/PerformanceTest/1024x1024.png" );
            textures [ 5 ] = contentManager.Load<ITexture2D> ( "Resources/PerformanceTest/2048x2048.png" );

            nodes = new Node [ 6 ];
            for ( int i = 0; i < 6; ++i )
            {
                nodes [ i ] = Add ( new Node () );
            }

            base.Intro ( args );
        }
Esempio n. 2
0
 public ParticleEngine2D( Vector2 position, int generateCountInOneTime, TimeSpan? generatePeriod = null, params ITexture2D [] textures )
 {
     random = new Random ();
     EmitterLocation = position;
     this.textures = textures.Clone () as ITexture2D [];
     GeneratePeriod = generatePeriod == null ? TimeSpan.FromMilliseconds ( 20 ) : generatePeriod.Value;
     GenerateCountInOneTime = generateCountInOneTime;
     BaseTTL = TimeSpan.FromMilliseconds ( 100 );
 }
Esempio n. 3
0
        public override void Intro( params object [] args )
        {
            LiqueurSystem.GraphicsDevice.CullingMode = CullingMode.None;

            Add ( InputHelper.CreateInstance () );

            FpsCalculator calc = new FpsCalculator ();
            calc.DrawEvent += ( object sender, GameTimeEventArgs e ) =>
            {
                int childrenCount = 0;
                for ( int i = 0; i < 6; ++i )
                    childrenCount += nodes [ i ].ChildrenCount;
                LiqueurSystem.Window.Title = string.Format ( "Update FPS: {0}, Draw FPS: {1}, Children count: {2}",
                    calc.UpdateFPS, calc.DrawFPS, childrenCount );
            };
            Add ( calc );

            ContentManager.ContentLoaderAssemblies.Add ( Assembly.Load ( "Daramkun.Liqueur.Spirit" ) );
            contentManager = new ContentManager ( FileSystemManager.GetFileSystem ( "ManifestFileSystem" ) );
            contentManager.AddDefaultContentLoader ();
            Texture2DContentLoader.AddDefaultDecoders ();

            textures = new ITexture2D [ 6 ];
            textures [ 0 ] = contentManager.Load<ITexture2D> ( "Test.Game.PerformanceTester.Resources.0096x0096.png" );
            textures [ 1 ] = contentManager.Load<ITexture2D> ( "Test.Game.PerformanceTester.Resources.0128x0128.png" );
            textures [ 2 ] = contentManager.Load<ITexture2D> ( "Test.Game.PerformanceTester.Resources.0256x0256.png" );
            textures [ 3 ] = contentManager.Load<ITexture2D> ( "Test.Game.PerformanceTester.Resources.0512x0512.png" );
            textures [ 4 ] = contentManager.Load<ITexture2D> ( "Test.Game.PerformanceTester.Resources.1024x1024.png" );
            textures [ 5 ] = contentManager.Load<ITexture2D> ( "Test.Game.PerformanceTester.Resources.2048x2048.png" );

            nodes = new Node [ 6 ];
            for ( int i = 0; i < 6; ++i )
            {
                nodes [ i ] = Add ( new Node () );
            }

            base.Intro ( args );
        }