+ // Create vertices
+ const float halfWidth = 0.5f;
+ const float halfHeight = 0.5f;
+ struct TexturedQuadVertex { Vector2 position; Vector2 textureCoordinates; };
+ TexturedQuadVertex texturedQuadVertexData[4] = { { Vector2(-halfWidth, -halfHeight), Vector2(0.f, 0.f) },
+ { Vector2( halfWidth, -halfHeight), Vector2(1.f, 0.f) },
+ { Vector2(-halfWidth, halfHeight), Vector2(0.f, 1.f) },
+ { Vector2( halfWidth, halfHeight), Vector2(1.f, 1.f) } };
+
+ Property::Map texturedQuadVertexFormat;
+ texturedQuadVertexFormat["aPosition"] = Property::VECTOR2;
+ texturedQuadVertexFormat["aTexCoord"] = Property::VECTOR2;
+ PropertyBuffer texturedQuadVertices = PropertyBuffer::New( texturedQuadVertexFormat, 4 );
+ texturedQuadVertices.SetData(texturedQuadVertexData);
+
+ // Create indices
+ //TODO: replace with triangle strip when Geometry supports it
+ unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
+ Property::Map indexFormat;
+ indexFormat["indices"] = Property::INTEGER;
+ PropertyBuffer indices = PropertyBuffer::New( indexFormat, 6 );
+ indices.SetData(indexData);
+
+ // Create the geometry object
+ Geometry texturedQuadGeometry = Geometry::New();
+ texturedQuadGeometry.AddVertexBuffer( texturedQuadVertices );
+ texturedQuadGeometry.SetIndexBuffer( indices );
+
+ return texturedQuadGeometry;
+}