- struct VertexNormal { Vector3 normal; };
-
- VertexPosition vertices[] = {
- { Vector2( -xsize, -xsize * aspect) },
- { Vector2( xsize, -xsize * aspect) },
- { Vector2( -xsize, xsize * aspect) },
- { Vector2( xsize, xsize * aspect) }
- };
-
- VertexTexture textures[] = {
- { Vector2(0.0f, 0.0f) },
- { Vector2(1.0f, 0.0f) },
- { Vector2(0.0f, 1.0f * aspect) },
- { Vector2(1.0f, 1.0f * aspect) }
- };
-
- VertexNormal normals [] = {
- { Vector3(0.0f, 0.0f, 1.0f) },
- { Vector3(0.0f, 0.0f, 1.0f) },
- { Vector3(0.0f, 0.0f, 1.0f) },
- { Vector3(0.0f, 0.0f, 1.0f) }
- };
-
- int indices[] = { 0, 3, 1, 0, 2, 3 };
-
- unsigned int numberOfVertices = sizeof(vertices)/sizeof(VertexPosition);
-
- //Vertices
- Property::Map positionVertexFormat;
- positionVertexFormat["aPosition"] = Property::VECTOR2;
- PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat, numberOfVertices );
- positionVertices.SetData(vertices);
-
- //Textures
- Property::Map textureVertexFormat;
- textureVertexFormat["aTexture"] = Property::VECTOR2;
- PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat, numberOfVertices );
- textureVertices.SetData(textures);
-
- //Normals
- Property::Map normalVertexFormat;
- normalVertexFormat["aNormal"] = Property::VECTOR3;
- PropertyBuffer normalVertices = PropertyBuffer::New( normalVertexFormat, numberOfVertices );
- normalVertices.SetData(normals);