Updates following rename of PropertyBuffer
[platform/core/uifw/dali-demo.git] / examples / rendering-skybox / rendering-skybox.cpp
index b9b2e50..45f5617 100644 (file)
@@ -147,9 +147,9 @@ public:
   // The Init signal is received once (only) during the Application lifetime
   void Create( Application& application )
   {
-    // Get a handle to the stage
-    Stage stage = Stage::GetCurrent();
-    stage.SetBackgroundColor( Color::WHITE );
+    // Get a handle to the window
+    Window window = application.GetWindow();
+    window.SetBackgroundColor( Color::WHITE );
 
     // Step 1. Setup camera
     SetupCamera();
@@ -175,7 +175,7 @@ public:
     PlayAnimation();
 
     // Respond to key events
-    stage.KeyEventSignal().Connect( this, &TexturedCubeController::OnKeyEvent );
+    window.KeyEventSignal().Connect( this, &TexturedCubeController::OnKeyEvent );
   }
 
   /**
@@ -200,12 +200,12 @@ public:
    */
   void SetupCamera()
   {
-    Stage stage = Stage::GetCurrent();
+    Window window = mApplication.GetWindow();
 
-    RenderTask renderTask = stage.GetRenderTaskList().GetTask( 0 );
+    RenderTask renderTask = window.GetRenderTaskList().GetTask( 0 );
     renderTask.SetCullMode( false ); // avoid frustum culling affecting the skybox
 
-    mCamera.Initialise( CAMERA_DEFAULT_POSITION, CAMERA_DEFAULT_FOV, CAMERA_DEFAULT_NEAR, CAMERA_DEFAULT_FAR );
+    mCamera.Initialise( window, CAMERA_DEFAULT_POSITION, CAMERA_DEFAULT_FOV, CAMERA_DEFAULT_NEAR, CAMERA_DEFAULT_FAR );
   }
 
   /**
@@ -272,9 +272,9 @@ public:
       { Vector3( -1.0f, 1.0f, 1.0f ), Vector2( 0.0, 0.0 ) },
     };
 
-    PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map()
-                                                       .Add( "aPosition", Property::VECTOR3 )
-                                                       .Add( "aTexCoord", Property::VECTOR2 ) );
+    VertexBuffer vertexBuffer = VertexBuffer::New( Property::Map()
+                                                   .Add( "aPosition", Property::VECTOR3 )
+                                                   .Add( "aTexCoord", Property::VECTOR2 ) );
     vertexBuffer.SetData( vertices, sizeof(vertices) / sizeof(Vertex) );
 
     // create indices
@@ -362,8 +362,8 @@ public:
         { Vector3(   1.0f, -1.0f,  1.0f ) }
     };
 
-    PropertyBuffer vertexBuffer = PropertyBuffer::New( Property::Map()
-                                                       .Add( "aPosition", Property::VECTOR3 ) );
+    VertexBuffer vertexBuffer = VertexBuffer::New( Property::Map()
+                                                   .Add( "aPosition", Property::VECTOR3 ) );
     vertexBuffer.SetData( skyboxVertices, sizeof(skyboxVertices) / sizeof(Vertex) );
 
     mSkyboxGeometry = Geometry::New();
@@ -404,8 +404,8 @@ public:
 
     mActor.SetProperty( Actor::Property::SIZE, Vector3( 10.f, 10.f, 10.f ) );
 
-    Stage stage = Stage::GetCurrent();
-    stage.Add( mActor );
+    Window window = mApplication.GetWindow();
+    window.Add( mActor );
   }
 
   /**
@@ -435,7 +435,7 @@ public:
     // The fragment shader will run only is those pixels that have the max depth value.
     mSkyboxRenderer.SetProperty( Renderer::Property::DEPTH_FUNCTION, DepthFunction::LESS_EQUAL );
 
-    Stage stage = Stage::GetCurrent();
+    Window window = mApplication.GetWindow();
 
     mSkyboxActor = Actor::New();
     mSkyboxActor.SetProperty( Dali::Actor::Property::NAME, "SkyBox" );
@@ -443,7 +443,7 @@ public:
     mSkyboxActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
     mSkyboxActor.SetProperty( Actor::Property::POSITION, CAMERA_DEFAULT_POSITION );
     mSkyboxActor.AddRenderer( mSkyboxRenderer );
-    stage.Add( mSkyboxActor );
+    window.Add( mSkyboxActor );
   }
 
   /**