/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
*/
// EXTERNAL INCLUDES
+#include <dali/devel-api/actors/actor-devel.h>
+#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
#include "shared/view.h"
-#include <dali-toolkit/dali-toolkit.h>
-
using namespace Dali;
namespace
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();
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 );
- mMeshActor.SetSize(400, 400);
+ mMeshActor.SetProperty( Actor::Property::SIZE, Vector2(400, 400) );
+ mMeshActor.SetProperty( DevelActor::Property::UPDATE_SIZE_HINT, Vector2(480, 700) );
- Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "morph-delta", 0.f );
- mMeshActor.AddUniformMapping( morphDeltaIndex, std::string("uDelta") );
+ 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 );
+ mMeshActor.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
+ mMeshActor.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
stage.Add( mMeshActor );
Animation animation = Animation::New(10);
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));
}
/**
Vector3 mStageSize; ///< The size of the stage
Shader mShader;
- Material mMaterial;
Geometry mGeometry;
Renderer mRenderer;
Actor mMeshActor;
Timer mMorphTimer;
};
-void RunTest( Application& application )
+int DALI_EXPORT_API main( int argc, char **argv )
{
+ Application application = Application::New( &argc, &argv );
ExampleController test( application );
-
application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
-int main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
return 0;
}