Exemple #1
0
        static MTLColorWriteMask TranslateColorWriteMask(MgColorComponentFlagBits writeMask)
        {
            AmtColorWriteMaskKey[] masks = new [] {
                new AmtColorWriteMaskKey {
                    Compare = MgColorComponentFlagBits.R_BIT, WriteMask = MTLColorWriteMask.Red
                },
                new AmtColorWriteMaskKey {
                    Compare = MgColorComponentFlagBits.G_BIT, WriteMask = MTLColorWriteMask.Green
                },
                new AmtColorWriteMaskKey {
                    Compare = MgColorComponentFlagBits.B_BIT, WriteMask = MTLColorWriteMask.Blue
                },
                new AmtColorWriteMaskKey {
                    Compare = MgColorComponentFlagBits.A_BIT, WriteMask = MTLColorWriteMask.Alpha
                },
            };

            MTLColorWriteMask output = MTLColorWriteMask.None;

            foreach (var key in masks)
            {
                if ((writeMask & key.Compare) == key.Compare)
                {
                    output |= key.WriteMask;
                }
            }


            return(output);
        }
Exemple #2
0
 public void SetColorMask(uint index, MgColorComponentFlagBits colorMask)
 {
     GL.ColorMask(
         index,
         (colorMask & MgColorComponentFlagBits.R_BIT) == MgColorComponentFlagBits.R_BIT,
         (colorMask & MgColorComponentFlagBits.G_BIT) == MgColorComponentFlagBits.G_BIT,
         (colorMask & MgColorComponentFlagBits.B_BIT) == MgColorComponentFlagBits.B_BIT,
         (colorMask & MgColorComponentFlagBits.A_BIT) == MgColorComponentFlagBits.A_BIT);
 }
Exemple #3
0
 public void SetColorMask(uint index, MgColorComponentFlagBits colorMask)
 {
 }