Example #1
0
 public void FormatToString()
 {
     var elements = new[] {
         new VertexElement(VertexElementType.Position3D),
         new VertexElement(VertexElementType.TextureUV) };
     var format = new VertexFormat(elements);
     Assert.AreEqual("VertexFormat: Position3D*3, TextureUV*2, Stride=20", format.ToString());
 }
Example #2
0
 public void HasProperties()
 {
     var elements = new[] {
         new VertexElement(VertexElementType.Position3D),
         new VertexElement(VertexElementType.TextureUV) };
     var format = new VertexFormat(elements);
     Assert.IsTrue(format.HasUV);
     Assert.IsTrue(format.Is3D);
     Assert.IsFalse(format.HasColor);
     Assert.IsFalse(format.HasNormal);
 }
Example #3
0
 public void AreEqual()
 {
     var elements = new[] {
         new VertexElement(VertexElementType.Position3D),
         new VertexElement(VertexElementType.TextureUV) };
     var format = new VertexFormat(elements);
     Assert.IsTrue(VertexFormat.Position3DUV.Equals(format));
     Assert.IsTrue(VertexFormat.Position3DUV.Equals((object)format));
     Assert.AreEqual(VertexFormat.Position3DUV, format);
     Assert.IsTrue(VertexFormat.Position3DUV == format);
     Assert.IsTrue(VertexFormat.Position2DUV.Equals(VertexFormat.Position2DUV));
     Assert.IsFalse(VertexFormat.Position2DUV == VertexFormat.Position2DColor);
     Assert.AreEqual(VertexFormat.Position2DUV, VertexFormat.Position2DUV);
     Assert.AreNotEqual(VertexFormat.Position2DUV, VertexFormat.Position2DColor);
     VertexFormat unassignedFormat = null;
     Assert.IsTrue(unassignedFormat == null);
 }
Example #4
0
 public void VertexFormatPosition3DTextureUVColor()
 {
     var elements = new[] {
         new VertexElement(VertexElementType.Position3D),
         new VertexElement(VertexElementType.TextureUV),
         new VertexElement(VertexElementType.Color)};
     var format = new VertexFormat(elements);
     Assert.AreEqual(24, format.Stride);
     Assert.AreEqual(0, elements[0].Offset);
     Assert.AreEqual(12, elements[1].Offset);
     Assert.AreEqual(20, elements[2].Offset);
 }
Example #5
0
 public void VertexFormatGetVertexElement()
 {
     var elements = new[] {
         new VertexElement(VertexElementType.Position3D),
         new VertexElement(VertexElementType.TextureUV) };
     var format = new VertexFormat(elements);
     Assert.IsNull(format.GetElementFromType(VertexElementType.Color));
     Assert.IsNotNull(format.GetElementFromType(VertexElementType.TextureUV));
 }
Example #6
0
		protected override void Preview(string contentName)
		{
			new Grid3D(new Size(10));
			var meshes = new[] { ContentLoader.Load<Mesh>(contentName) };
			new Model(new ModelData(meshes), new Vector3D(0, 0, 0));
		}