SpriteTests DrawSpritesWithDifferentBlendModes Method Delta Engine Documentation

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

public void DrawSpritesWithDifferentBlendModes()
Examples

[Test, ApproveFirstFrameScreenshot]
public void DrawSpritesWithDifferentBlendModes()
{
    var opaqueMaterial = new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogoOpaque");
    var alphaMaterial = new Material(ShaderFlags.Position2DTextured, "DeltaEngineLogoAlpha");
    var drawAreas = CreateDrawAreas(3, 2);
    new Sprite(opaqueMaterial, drawAreas[0]) { BlendMode = BlendMode.Opaque };
    new Sprite(alphaMaterial, drawAreas[1]) { BlendMode = BlendMode.Opaque };
    new Sprite(opaqueMaterial, drawAreas[2]) { BlendMode = BlendMode.Normal };
    new Sprite(alphaMaterial, drawAreas[3]) { BlendMode = BlendMode.Normal };
    new Sprite(opaqueMaterial, drawAreas[4]) { BlendMode = BlendMode.Additive };
    new Sprite(alphaMaterial, drawAreas[5]) { BlendMode = BlendMode.Additive };
    new Sprite(opaqueMaterial, drawAreas[6]) { BlendMode = BlendMode.AlphaTest };
    new Sprite(alphaMaterial, drawAreas[7]) { BlendMode = BlendMode.AlphaTest };
    new Sprite(opaqueMaterial, drawAreas[8]) { BlendMode = BlendMode.LightEffect };
    new Sprite(alphaMaterial, drawAreas[9]) { BlendMode = BlendMode.LightEffect };
    new Sprite(opaqueMaterial, drawAreas[10]) { BlendMode = BlendMode.Subtractive };
    new Sprite(alphaMaterial, drawAreas[11]) { BlendMode = BlendMode.Subtractive };
    Resolve<Window>().Title =
        "Blend modes: Opaque, Normal, Additive, AlphaTest, LightEffect, Subtractive";
}
See Also