Beispiel #1
0
        public ContextBlendBindings(IContext context, IContextCaps caps)
        {
            BlendEnable      = new EnableCapBinding(context, EnableCap.Blend);
            BlendColor       = new Binding <Color4>(context, (c, x) => c.GL.BlendColor(x.Red, x.Green, x.Blue, x.Alpha));
            SampleMaskEnable = new EnableCapBinding(context, EnableCap.SampleMask);
            SampleMasks      = Enumerable.Range(0, caps.MaxSampleMaskWords)
                               .Select(i => new Binding <uint>(context, (c, x) => c.GL.SampleMask((uint)i, x)))
                               .ToArray();
            AlphaToCoverageEnable = new EnableCapBinding(context, EnableCap.SampleAlphaToCoverage);

            United   = new ContextBlendTargetBinding(context, null);
            Separate = Enumerable.Range(0, caps.MaxDrawBuffers)
                       .Select(i => new ContextBlendTargetBinding(context, i))
                       .ToArray();
        }
        public ContextBlendBindings(IContext context, IContextCaps caps)
        {
            BlendEnable = new EnableCapBinding(context, EnableCap.Blend);
            BlendColor = new Binding<Color4>(context, (c, x) => c.GL.BlendColor(x.Red, x.Green, x.Blue, x.Alpha));
            SampleMaskEnable = new EnableCapBinding(context, EnableCap.SampleMask);
            SampleMasks = Enumerable.Range(0, caps.MaxSampleMaskWords)
                .Select(i => new Binding<uint>(context, (c, x) => c.GL.SampleMask((uint)i, x)))
                .ToArray();
            AlphaToCoverageEnable = new EnableCapBinding(context, EnableCap.SampleAlphaToCoverage);

            United = new ContextBlendTargetBinding(context, null);
            Separate = Enumerable.Range(0, caps.MaxDrawBuffers)
                .Select(i => new ContextBlendTargetBinding(context, i))
                .ToArray();
        }