public void InvalidVertexAndPixelCode() { var data = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", VertexFormat.Position2DColor); Assert.Throws<ShaderWithFormat.NoShaderCodeSpecifiedForOpenGLAndDirectX>( () => ContentLoader.Create<Shader>(data)); }
public void AllowDynamicCreationViaCreationData() { var data = new ShaderWithFormatCreationData(ShaderFlags.None, "AnyData", "AnyData", "AnyData", "AnyData", VertexFormat.Position2DColor); var shader = ContentLoader.Create<NoDataShaderWithFormat>(data); Assert.DoesNotThrow(() => shader.ReloadCreationData(data)); }
public void InvalidVertexAndPixelCode() { var data = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", VertexFormat.Position2DColor); Assert.Throws <ShaderWithFormat.NoShaderCodeSpecifiedForOpenGLAndDirectX>( () => ContentLoader.Create <Shader>(data)); }
public void AllowDynamicCreationViaCreationData() { var data = new ShaderWithFormatCreationData(ShaderFlags.None, "AnyData", "AnyData", "AnyData", "AnyData", VertexFormat.Position2DColor); var shader = ContentLoader.Create <NoDataShaderWithFormat>(data); Assert.DoesNotThrow(() => shader.ReloadCreationData(data)); }
public void InvalidVertexFormat() { var invalidData = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", null); Assert.Throws<ShaderWithFormat.InvalidVertexFormat>( () => ContentLoader.Create<Shader>(invalidData)); var emptyFormat = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", new VertexFormat(new VertexElement[0])); Assert.Throws<ShaderWithFormat.InvalidVertexFormat>( () => ContentLoader.Create<Shader>(emptyFormat)); }
private static void AssertShaderCreationException(ShaderWithFormatCreationData creationData) { try { ContentLoader.Create <ShaderWithFormat>(creationData); } //ncrunch: no coverage catch (Exception ex) { Console.WriteLine(ex.Message); Assert.IsTrue(ex is Shader.ShaderCreationHasFailed, ex.ToString()); } }
public void InvalidVertexFormat() { var invalidData = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", null); Assert.Throws <ShaderWithFormat.InvalidVertexFormat>( () => ContentLoader.Create <Shader>(invalidData)); var emptyFormat = new ShaderWithFormatCreationData(ShaderFlags.None, "", "", "", "", new VertexFormat(new VertexElement[0])); Assert.Throws <ShaderWithFormat.InvalidVertexFormat>( () => ContentLoader.Create <Shader>(emptyFormat)); }
public void CreationOfShaderWithInvalidShaderCodeMustFail() { var creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "BadGLVertexCode", "BadGLFragmentCode", "BadDX11Code", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "AnyData", "BadGLFragmentCode", "BadDX11Code", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "AnyData", "AnyData", "BadDX11Code", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "AnyData", "AnyData", "AnyData", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); }
public void CreationOfShaderWithInvalidShaderCodeMustFail() { var creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "BadGLVertexCode", "BadGLFragmentCode", "BadDX11Code", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "AnyData", "BadGLFragmentCode", "BadDX11Code", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "AnyData", "AnyData", "BadDX11Code", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); creationData = new ShaderWithFormatCreationData(ShaderFlags.Colored, "AnyData", "AnyData", "AnyData", "BadDX9Code", VertexFormat.Position3DColor); AssertShaderCreationException(creationData); }
private SharpDXShader(ShaderWithFormatCreationData creationData, SharpDXDevice device) : this((ShaderCreationData)creationData, device) {}
public MockShader(ShaderWithFormatCreationData creationData, Device device) : this((ShaderCreationData)creationData, device) {}
public OpenGLShader(ShaderWithFormatCreationData creationData, OpenGLDevice device) : this((ShaderCreationData)creationData, device) {}
protected GLFW3Shader(ShaderWithFormatCreationData creationData, GLFW3Device device) : this((ShaderCreationData)creationData, device) { }
private SharpDXShader(ShaderWithFormatCreationData creationData, SharpDXDevice device) : this((ShaderCreationData)creationData, device) { }
public NoDataShaderWithFormat(ShaderWithFormatCreationData creationData, Device device) : base(creationData, device) { }
private XnaShader(ShaderWithFormatCreationData creationData, XnaDevice device) : this((ShaderCreationData)creationData, device) { }
public OpenTKShader(ShaderWithFormatCreationData creationData, OpenTK20Device device) : this((ShaderCreationData)creationData, device) { }
public void ReloadCreationData(ShaderWithFormatCreationData creationData) { byte[] rawData = creationData.VertexCode == "NoData" ? new byte[0] : BinaryDataExtensions.ToByteArrayWithTypeInformation(creationData); LoadData(new MemoryStream(rawData)); }
private XnaShader(ShaderWithFormatCreationData creationData, XnaDevice device) : this((ShaderCreationData)creationData, device) {}
private static void AssertShaderCreationException(ShaderWithFormatCreationData creationData) { try { ContentLoader.Create<ShaderWithFormat>(creationData); } //ncrunch: no coverage catch (Exception ex) { Console.WriteLine(ex.Message); Assert.IsTrue(ex is Shader.ShaderCreationHasFailed, ex.ToString()); } }
//ncrunch: no coverage start internal FakeShader(ShaderWithFormatCreationData creationData) : base(creationData) { }
public NoDataShaderWithFormat(ShaderWithFormatCreationData creationData, Device device) : base(creationData, device) { }
public MockShader(ShaderWithFormatCreationData creationData, Device device) : this((ShaderCreationData)creationData, device) { }
public void ReloadCreationData(ShaderWithFormatCreationData creationData) { byte[] rawData = creationData.VertexCode == "NoData" ? new byte[0] : BinaryDataExtensions.ToByteArrayWithTypeInformation(creationData); LoadData(new MemoryStream(rawData)); }