projects
/
platform
/
core
/
uifw
/
dali-demo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Using migrated Public Visual API
[platform/core/uifw/dali-demo.git]
/
examples
/
mesh-morph
/
mesh-morph-example.cpp
diff --git
a/examples/mesh-morph/mesh-morph-example.cpp
b/examples/mesh-morph/mesh-morph-example.cpp
index
5c99097
..
ebf3654
100644
(file)
--- a/
examples/mesh-morph/mesh-morph-example.cpp
+++ b/
examples/mesh-morph/mesh-morph-example.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
4
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
7
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-16,12
+16,11
@@
*/
// EXTERNAL INCLUDES
*/
// EXTERNAL INCLUDES
+#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
#include "shared/view.h"
// INTERNAL INCLUDES
#include "shared/view.h"
-#include <dali-toolkit/dali-toolkit.h>
-
using namespace Dali;
namespace
using namespace Dali;
namespace
@@
-218,18
+217,18
@@
Geometry CreateGeometry()
Property::Map initialPositionVertexFormat;
initialPositionVertexFormat["aInitPos"] = Property::VECTOR2;
Property::Map initialPositionVertexFormat;
initialPositionVertexFormat["aInitPos"] = Property::VECTOR2;
- PropertyBuffer initialPositionVertices = PropertyBuffer::New(
PropertyBuffer::STATIC, initialPositionVertexFormat, numberOfVertices
);
- initialPositionVertices.SetData(
quad
);
+ PropertyBuffer initialPositionVertices = PropertyBuffer::New(
initialPositionVertexFormat
);
+ initialPositionVertices.SetData(
quad, numberOfVertices
);
Property::Map finalPositionVertexFormat;
finalPositionVertexFormat["aFinalPos"] = Property::VECTOR2;
Property::Map finalPositionVertexFormat;
finalPositionVertexFormat["aFinalPos"] = Property::VECTOR2;
- PropertyBuffer finalPositionVertices = PropertyBuffer::New(
PropertyBuffer::STATIC, finalPositionVertexFormat, numberOfVertices
);
- finalPositionVertices.SetData(
cat
);
+ PropertyBuffer finalPositionVertices = PropertyBuffer::New(
finalPositionVertexFormat
);
+ finalPositionVertices.SetData(
cat, numberOfVertices
);
Property::Map colorVertexFormat;
colorVertexFormat["aColor"] = Property::VECTOR3;
Property::Map colorVertexFormat;
colorVertexFormat["aColor"] = Property::VECTOR3;
- PropertyBuffer colorVertices = PropertyBuffer::New(
PropertyBuffer::STATIC, colorVertexFormat, numberOfVertices
);
- colorVertices.SetData(
colors
);
+ PropertyBuffer colorVertices = PropertyBuffer::New(
colorVertexFormat
);
+ colorVertices.SetData(
colors, numberOfVertices
);
// Create the geometry object
Geometry texturedQuadGeometry = Geometry::New();
// Create the geometry object
Geometry texturedQuadGeometry = Geometry::New();
@@
-292,20
+291,16
@@
public:
application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
-
- mMaterial = Material::New( mShader );
mGeometry = CreateGeometry();
mGeometry = CreateGeometry();
-
- mRenderer = Renderer::New( mGeometry, mMaterial );
+ mRenderer = Renderer::New( mGeometry, mShader );
mMeshActor = Actor::New();
mMeshActor.AddRenderer( mRenderer );
mMeshActor.SetSize(400, 400);
mMeshActor = Actor::New();
mMeshActor.AddRenderer( mRenderer );
mMeshActor.SetSize(400, 400);
- Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "morph-delta", 0.f );
- mMeshActor.AddUniformMapping( morphDeltaIndex, std::string("uDelta") );
+ Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f );
- mRenderer.Set
DepthIndex(0
);
+ mRenderer.Set
Property( Renderer::Property::DEPTH_INDEX, 0
);
mMeshActor.SetParentOrigin( ParentOrigin::CENTER );
mMeshActor.SetAnchorPoint( AnchorPoint::CENTER );
mMeshActor.SetParentOrigin( ParentOrigin::CENTER );
mMeshActor.SetAnchorPoint( AnchorPoint::CENTER );
@@
-316,7
+311,7
@@
public:
animation.SetLooping( true );
animation.Play();
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));
}
/**
}
/**
@@
-347,7
+342,6
@@
private:
Vector3 mStageSize; ///< The size of the stage
Shader mShader;
Vector3 mStageSize; ///< The size of the stage
Shader mShader;
- Material mMaterial;
Geometry mGeometry;
Renderer mRenderer;
Actor mMeshActor;
Geometry mGeometry;
Renderer mRenderer;
Actor mMeshActor;
@@
-363,7
+357,7
@@
void RunTest( Application& application )
// Entry point for Linux & SLP applications
//
// 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 );
{
Application application = Application::New( &argc, &argv );