X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fmesh-morph%2Fmesh-morph-example.cpp;h=ebf3654aae67bd2a03e90f8e2a79c599a8877c32;hb=a832af2813558a32f0a18747f3e6134ff6f6f301;hp=baf9ff6274539c33a27ab7c54e590c4b83c9fd3e;hpb=8d10a2d0f9e9adb56a41a258c73a818eca4f0b4e;p=platform%2Fcore%2Fuifw%2Fdali-demo.git diff --git a/examples/mesh-morph/mesh-morph-example.cpp b/examples/mesh-morph/mesh-morph-example.cpp index baf9ff6..ebf3654 100644 --- a/examples/mesh-morph/mesh-morph-example.cpp +++ b/examples/mesh-morph/mesh-morph-example.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,6 @@ */ // EXTERNAL INCLUDES -#include #include // INTERNAL INCLUDES @@ -218,18 +217,18 @@ Geometry CreateGeometry() Property::Map initialPositionVertexFormat; initialPositionVertexFormat["aInitPos"] = Property::VECTOR2; - PropertyBuffer initialPositionVertices = PropertyBuffer::New( initialPositionVertexFormat, numberOfVertices ); - initialPositionVertices.SetData(quad); + PropertyBuffer initialPositionVertices = PropertyBuffer::New( initialPositionVertexFormat ); + initialPositionVertices.SetData( quad, numberOfVertices ); Property::Map finalPositionVertexFormat; finalPositionVertexFormat["aFinalPos"] = Property::VECTOR2; - PropertyBuffer finalPositionVertices = PropertyBuffer::New( finalPositionVertexFormat, numberOfVertices ); - finalPositionVertices.SetData(cat); + PropertyBuffer finalPositionVertices = PropertyBuffer::New( finalPositionVertexFormat ); + finalPositionVertices.SetData( cat, numberOfVertices ); Property::Map colorVertexFormat; colorVertexFormat["aColor"] = Property::VECTOR3; - PropertyBuffer colorVertices = PropertyBuffer::New( colorVertexFormat, numberOfVertices ); - colorVertices.SetData(colors); + PropertyBuffer colorVertices = PropertyBuffer::New( colorVertexFormat ); + colorVertices.SetData( colors, numberOfVertices ); // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); @@ -292,11 +291,8 @@ public: application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER ); - - mMaterial = Material::New( mShader ); mGeometry = CreateGeometry(); - - mRenderer = Renderer::New( mGeometry, mMaterial ); + mRenderer = Renderer::New( mGeometry, mShader ); mMeshActor = Actor::New(); mMeshActor.AddRenderer( mRenderer ); @@ -304,7 +300,7 @@ public: Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f ); - mRenderer.SetDepthIndex(0); + mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 ); mMeshActor.SetParentOrigin( ParentOrigin::CENTER ); mMeshActor.SetAnchorPoint( AnchorPoint::CENTER ); @@ -315,7 +311,7 @@ public: animation.SetLooping( true ); animation.Play(); - stage.SetBackgroundColor(Vector4(0.0f, 0.2f, 0.2f, 1.0f));; + stage.SetBackgroundColor(Vector4(0.0f, 0.2f, 0.2f, 1.0f)); } /** @@ -346,7 +342,6 @@ private: Vector3 mStageSize; ///< The size of the stage Shader mShader; - Material mMaterial; Geometry mGeometry; Renderer mRenderer; Actor mMeshActor; @@ -362,7 +357,7 @@ void RunTest( Application& application ) // Entry point for Linux & SLP applications // -int main( int argc, char **argv ) +int DALI_EXPORT_API main( int argc, char **argv ) { Application application = Application::New( &argc, &argv );