PerformanceTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Rendering2D.Tests PerformanceTests

Namespace: DeltaEngine.Rendering2D.Tests
Assembly: DeltaEngine.Rendering2D.Tests (in DeltaEngine.Rendering2D.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class PerformanceTests : TestWithMocksOrVisually

The PerformanceTests type exposes the following members.

Constructors

  NameDescription
Public methodPerformanceTests
Initializes a new instance of the PerformanceTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodDraw10000SpritesPerFrame
Draws 100*100 sprites each frame to test rendering performance (millions of polygons/s). View code on GitHub
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

/// <summary> 
/// Draws 100*100 sprites each frame to test rendering performance (millions of polygons/s). 
/// </summary>
[Test]
public void Draw10000SpritesPerFrame()
{
    var material = new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogo");
    for (int y = 0; y < 100; y++)
        for (int x = 0; x < 100; x++)
            new Sprite(material, new Rectangle(x / 100.0f, y / 100.0f, 0.01f, 0.01f));
    new FpsDisplay();
}
See Also