Example #1
0
 public RenderState()
 {
     PrimitiveRestart = new PrimitiveRestart();
     FacetCulling = new FacetCulling();
     ProgramPointSize = ProgramPointSize.Disabled;
     RasterizationMode = RasterizationMode.Fill;
     ScissorTest = new ScissorTest();
     StencilTest = new StencilTest();
     DepthTest = new DepthTest();
     DepthRange = new DepthRange();
     Blending = new Blending();
     ColorMask = new ColorMask(true, true, true, true);
     DepthMask = true;
 }
Example #2
0
 public RenderState()
 {
     PrimitiveRestart  = new PrimitiveRestart();
     FacetCulling      = new FacetCulling();
     ProgramPointSize  = ProgramPointSize.Disabled;
     RasterizationMode = RasterizationMode.Fill;
     ScissorTest       = new ScissorTest();
     StencilTest       = new StencilTest();
     DepthTest         = new DepthTest();
     DepthRange        = new DepthRange();
     Blending          = new Blending();
     ColorMask         = new ColorMask(true, true, true, true);
     DepthMask         = true;
 }
        public void Blending()
        {
            Blending blending = new Blending();

            blending.Enabled                = true;
            blending.SourceRGBFactor        = SourceBlendingFactor.SourceAlpha;
            blending.SourceAlphaFactor      = SourceBlendingFactor.SourceAlpha;
            blending.DestinationRGBFactor   = DestinationBlendingFactor.OneMinusSourceAlpha;
            blending.DestinationAlphaFactor = DestinationBlendingFactor.OneMinusSourceAlpha;
            blending.RGBEquation            = BlendEquation.Add;
            blending.AlphaEquation          = BlendEquation.Add;
            blending.Color = Color.White;

            Assert.IsTrue(blending.Enabled);
            Assert.AreEqual(SourceBlendingFactor.SourceAlpha, blending.SourceRGBFactor);
            Assert.AreEqual(SourceBlendingFactor.SourceAlpha, blending.SourceAlphaFactor);
            Assert.AreEqual(DestinationBlendingFactor.OneMinusSourceAlpha, blending.DestinationRGBFactor);
            Assert.AreEqual(DestinationBlendingFactor.OneMinusSourceAlpha, blending.DestinationAlphaFactor);
            Assert.AreEqual(BlendEquation.Add, blending.RGBEquation);
            Assert.AreEqual(BlendEquation.Add, blending.AlphaEquation);
            Assert.AreEqual(Color.White, blending.Color);
        }
        public void Blending()
        {
            Blending blending = new Blending();
            blending.Enabled = true;
            blending.SourceRGBFactor = SourceBlendingFactor.SourceAlpha;
            blending.SourceAlphaFactor = SourceBlendingFactor.SourceAlpha;
            blending.DestinationRGBFactor = DestinationBlendingFactor.OneMinusSourceAlpha;
            blending.DestinationAlphaFactor = DestinationBlendingFactor.OneMinusSourceAlpha;
            blending.RGBEquation = BlendEquation.Add;
            blending.AlphaEquation = BlendEquation.Add;
            blending.Color = Color.White;

            Assert.IsTrue(blending.Enabled);
            Assert.AreEqual(SourceBlendingFactor.SourceAlpha, blending.SourceRGBFactor);
            Assert.AreEqual(SourceBlendingFactor.SourceAlpha, blending.SourceAlphaFactor);
            Assert.AreEqual(DestinationBlendingFactor.OneMinusSourceAlpha, blending.DestinationRGBFactor);
            Assert.AreEqual(DestinationBlendingFactor.OneMinusSourceAlpha, blending.DestinationAlphaFactor);
            Assert.AreEqual(BlendEquation.Add, blending.RGBEquation);
            Assert.AreEqual(BlendEquation.Add, blending.AlphaEquation);
            Assert.AreEqual(Color.White, blending.Color);
        }