- float size( allocated );
-
- switch( policy )
- {
- case Control::Fixed:
- {
- // Use allocated value
- break;
- }
-
- case Control::Minimum:
- {
- // Size is always at least the minimum.
- size = std::max( allocated, minimum );
- break;
- }
-
- case Control::Maximum:
- {
- // Size can grow but up to a maximum value.
- size = std::min( allocated, maximum );
- break;
- }
-
- case Control::Range:
- {
- // Size is at least the minimum and can grow up to the maximum
- size = std::max( size, minimum );
- size = std::min( size, maximum );
- break;
- }
-
- case Control::Flexible:
- {
- // Size grows or shrinks with no limits.
- size = allocated;
- break;
- }
-
- default:
- {
- DALI_ASSERT_DEBUG( false && "This function was not intended to be used by any other policy." );
- break;
- }
- }
+ Vector3 white( Color::WHITE );
+
+ MeshData meshData;
+
+ // Create vertices with a white color (actual color is set by actor color)
+ MeshData::VertexContainer vertices(4);
+ vertices[ 0 ] = MeshData::Vertex( Vector3( -0.5f, -0.5f, 0.0f ), Vector2::ZERO, white );
+ vertices[ 1 ] = MeshData::Vertex( Vector3( 0.5f, -0.5f, 0.0f ), Vector2::ZERO, white );
+ vertices[ 2 ] = MeshData::Vertex( Vector3( -0.5f, 0.5f, 0.0f ), Vector2::ZERO, white );
+ vertices[ 3 ] = MeshData::Vertex( Vector3( 0.5f, 0.5f, 0.0f ), Vector2::ZERO, white );
+
+ // Specify all the faces
+ MeshData::FaceIndices faces;
+ faces.reserve( 6 ); // 2 triangles in Quad
+ faces.push_back( 0 ); faces.push_back( 3 ); faces.push_back( 1 );
+ faces.push_back( 0 ); faces.push_back( 2 ); faces.push_back( 3 );
+
+ // Create the mesh data from the vertices and faces
+ meshData.SetMaterial( Material::New( "ControlMaterial" ) );
+ meshData.SetVertices( vertices );
+ meshData.SetFaceIndices( faces );
+ meshData.SetHasColor( true );
+
+ return Mesh::New( meshData );
+}