示例#1
0
        internal static BlendId CreateBlendState(BlendStateDescription description)
        {
            var id = new BlendId { Index = BlendStates.Allocate() };
            MyArrayHelpers.Reserve(ref BlendObjects, id.Index + 1);

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

            InitBlendState(id);
            BlendIndices.Add(id);

            return id;
        }
示例#2
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);
        }