コード例 #1
0
 public static BlendId CreateBlendState(BlendStateDescription description)
 {
     BlendId id = new BlendId();
     CreateBlendState(ref id, description);
     return id;
 }
コード例 #2
0
 internal static BlendState GetBlend(BlendId id)
 {
     return BlendObjects[id.Index];
 }
コード例 #3
0
 private static void InitBlendState(BlendId id)
 {
     if (BlendObjects[id.Index] == null)
         BlendObjects[id.Index] = new BlendState(MyRender11.Device, BlendStates.Data[id.Index]);
 }
コード例 #4
0
        public static void CreateBlendState(ref BlendId id, BlendStateDescription description)
        {
            if (id == BlendId.NULL)
            {
                id = new BlendId(BlendStates.Allocate());
                MyArrayHelpers.Reserve(ref BlendObjects, id.Index + 1);
                BlendIndices.Add(id);
            }
            else
            {
                BlendObjects[id.Index].Dispose();
            }

            BlendStates.Data[id.Index] = description.Clone();
            InitBlendState(id);
        }