Update following the changes of Blending&Culling options
[platform/core/uifw/dali-demo.git] / examples / mesh-sorting / mesh-sorting-example.cpp
index 248a4c3..4dc7237 100644 (file)
@@ -32,12 +32,12 @@ namespace
 
 const char* MATERIAL_SAMPLES[] =
 {
-  DALI_IMAGE_DIR "people-medium-1.jpg",
-  DALI_IMAGE_DIR "people-medium-4.jpg",
-  DALI_IMAGE_DIR "people-medium-11.jpg",
-  DALI_IMAGE_DIR "people-small-16.jpg",
-  DALI_IMAGE_DIR "people-medium-15.jpg",
-  DALI_IMAGE_DIR "people-medium-6.jpg",
+  DEMO_IMAGE_DIR "people-medium-1.jpg",
+  DEMO_IMAGE_DIR "people-medium-4.jpg",
+  DEMO_IMAGE_DIR "people-medium-11.jpg",
+  DEMO_IMAGE_DIR "people-small-16.jpg",
+  DEMO_IMAGE_DIR "people-medium-15.jpg",
+  DEMO_IMAGE_DIR "people-medium-6.jpg",
 };
 const unsigned int NUMBER_OF_SAMPLES(sizeof(MATERIAL_SAMPLES)/sizeof(const char*));
 
@@ -104,7 +104,7 @@ Geometry CreateGeometry()
   // Create indices
   unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 };
   Property::Map indexFormat;
-  indexFormat["indices"] = Property::UNSIGNED_INTEGER;
+  indexFormat["indices"] = Property::INTEGER;
   PropertyBuffer indices = PropertyBuffer::New( indexFormat, 6 );
   indices.SetData(indexData);
 
@@ -169,9 +169,8 @@ public:
     for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)
     {
       Image image = ResourceImage::New( MATERIAL_SAMPLES[i] );
-      Sampler sampler = Sampler::New(image, "sTexture");
       Material material = Material::New( mShader );
-      material.AddSampler( sampler );
+      material.AddTexture(image, "sTexture");
       if( i==0 ) { firstMat = material; }
 
       Renderer renderer = Renderer::New( mGeometry, material );
@@ -181,7 +180,7 @@ public:
       meshActor.SetSize(175, 175);
       meshActor.RegisterProperty("index", (int)i);
 
-      renderer.SetDepthIndex(0);
+      renderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
       // Test with actor alpha
       meshActor.SetParentOrigin( ParentOrigin::CENTER );
       meshActor.SetAnchorPoint( AnchorPoint::CENTER );
@@ -241,7 +240,7 @@ public:
       mDepthIndices[index] = newDepthIndex;
 
       Renderer renderer = actor.GetRendererAt(0);
-      renderer.SetDepthIndex(newDepthIndex);
+      renderer.SetProperty( Renderer::Property::DEPTH_INDEX, newDepthIndex);
 
       PrintDepths();
     }