예제 #1
0
 public ContextDepthStencilBindings(IContext context)
 {
     Front             = new ContextDepthStencilSideBindings(context, (int)All.Front);
     Back              = new ContextDepthStencilSideBindings(context, (int)All.Back);
     DepthTestEnable   = new EnableCapBinding(context, EnableCap.DepthTest);
     DepthMask         = new Binding <bool>(context, (c, x) => c.GL.DepthMask(x));
     DepthFunc         = new Binding <DepthFunction>(context, (c, x) => c.GL.DepthFunc((int)x));
     StencilTestEnable = new EnableCapBinding(context, EnableCap.StencilTest);
 }
 public ContextDepthStencilBindings(IContext context)
 {
     Front = new ContextDepthStencilSideBindings(context, (int)All.Front);
     Back = new ContextDepthStencilSideBindings(context, (int)All.Back);
     DepthTestEnable = new EnableCapBinding(context, EnableCap.DepthTest);
     DepthMask = new Binding<bool>(context, (c, x) => c.GL.DepthMask(x));
     DepthFunc = new Binding<DepthFunction>(context, (c, x) => c.GL.DepthFunc((int)x));
     StencilTestEnable = new EnableCapBinding(context, EnableCap.StencilTest);
 }
 public ContextRasterizerBindings(IContext context)
 {
     PolygonModeFront  = new Binding <PolygonMode>(context, (c, x) => c.GL.PolygonMode((int)All.Front, (int)x));
     PolygonModeBack   = new Binding <PolygonMode>(context, (c, x) => c.GL.PolygonMode((int)All.Back, (int)x));
     CullFace          = new Binding <CullFaceMode>(context, (c, x) => c.GL.CullFace((int)x));
     FrontFace         = new Binding <FrontFaceDirection>(context, (c, x) => c.GL.FrontFace((int)x));
     CullFaceEnable    = new EnableCapBinding(context, EnableCap.CullFace);
     ScissorEnable     = new EnableCapBinding(context, EnableCap.ScissorTest);
     MultisampleEnable = new EnableCapBinding(context, EnableCap.Multisample);
     LineSmoothEnable  = new EnableCapBinding(context, EnableCap.LineSmooth);
 }
예제 #4
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();
        }
예제 #5
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();
        }