public static BlendId CreateBlendState(BlendStateDescription description) { BlendId id = new BlendId(); CreateBlendState(ref id, description); return id; }
internal static BlendState GetBlend(BlendId id) { return BlendObjects[id.Index]; }
private static void InitBlendState(BlendId id) { if (BlendObjects[id.Index] == null) BlendObjects[id.Index] = new BlendState(MyRender11.Device, BlendStates.Data[id.Index]); }
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); }