private static ExtendedMaterial[] GetMaterialsFromBrushes(Device device, Color defaultColor, DirectXModel m, IPlaneBrush[] brushesInOrder) { var materials = new ExtendedMaterial[brushesInOrder.Length]; var converter = new DirectXBrushConverter(device); for (int i = 0; i < materials.Length; i++) { materials[i] = defaultColor.GetDirectXMaterial(); if (brushesInOrder[i] == null) { continue; } Texture texture; materials[i] = converter.TryConvert(brushesInOrder[i], out texture); if (texture != null) { m.Textures[i] = texture; } } return(materials); }
public void SetUp() { _deviceWorker = new DeviceWorker(); _converter = new DirectXBrushConverter(_deviceWorker.Device); }