Use UNSIGNED_INT for index buffers. 86/38886/1
authorFrancisco Santos <f1.santos@samsung.com>
Wed, 29 Apr 2015 16:27:01 +0000 (17:27 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Wed, 29 Apr 2015 16:27:01 +0000 (17:27 +0100)
Change-Id: I0f13e936dfbb156885606d23d0d3d1bb9914faf5

examples/line-mesh/line-mesh-example.cpp
examples/textured-mesh/textured-mesh-example.cpp

index 2d2b68a..9b5ec4c 100644 (file)
@@ -91,10 +91,10 @@ Geometry CreateGeometry()
   pentacleVertices.SetData(pentacleVertexData);
 
   // Create indices
-  unsigned short indexData[10] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 0 };
+  unsigned int indexData[10] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 0 };
   Property::Map indexFormat;
   indexFormat["indices"] = Property::UNSIGNED_INTEGER;
-  PropertyBuffer indices = PropertyBuffer::New( PropertyBuffer::STATIC, indexFormat, 5 );
+  PropertyBuffer indices = PropertyBuffer::New( PropertyBuffer::STATIC, indexFormat, sizeof(indexData)/sizeof(indexData[0]) );
   indices.SetData(indexData);
 
   // Create the geometry object
index e057616..f5f5574 100644 (file)
@@ -79,10 +79,10 @@ Geometry CreateGeometry()
   texturedQuadVertices.SetData(texturedQuadVertexData);
 
   // Create indices
-  unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 };
+  unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
   Property::Map indexFormat;
   indexFormat["indices"] = Property::UNSIGNED_INTEGER;
-  PropertyBuffer indices = PropertyBuffer::New( PropertyBuffer::STATIC, indexFormat, 3 );
+  PropertyBuffer indices = PropertyBuffer::New( PropertyBuffer::STATIC, indexFormat, sizeof(indexData)/sizeof(indexData[0]) );
   indices.SetData(indexData);
 
   // Create the geometry object