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
Updates following rename of PropertyBuffer
[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
ce5f61e
..
35bbc39
100644
(file)
--- a/
examples/mesh-morph/mesh-morph-example.cpp
+++ b/
examples/mesh-morph/mesh-morph-example.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 20
14
Samsung Electronics Co., Ltd.
+ * Copyright (c) 20
20
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,7
+16,7
@@
*/
// EXTERNAL INCLUDES
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/
rendering/renderer
.h>
+#include <dali/devel-api/
actors/actor-devel
.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
@@
-218,18
+218,18
@@
Geometry CreateGeometry()
Property::Map initialPositionVertexFormat;
initialPositionVertexFormat["aInitPos"] = Property::VECTOR2;
Property::Map initialPositionVertexFormat;
initialPositionVertexFormat["aInitPos"] = Property::VECTOR2;
-
PropertyBuffer initialPositionVertices = PropertyBuffer::New( initialPositionVertexFormat, numberOfVertices
);
- initialPositionVertices.SetData(
quad
);
+
VertexBuffer initialPositionVertices = VertexBuffer::New( initialPositionVertexFormat
);
+ initialPositionVertices.SetData(
quad, numberOfVertices
);
Property::Map finalPositionVertexFormat;
finalPositionVertexFormat["aFinalPos"] = Property::VECTOR2;
Property::Map finalPositionVertexFormat;
finalPositionVertexFormat["aFinalPos"] = Property::VECTOR2;
-
PropertyBuffer finalPositionVertices = PropertyBuffer::New( finalPositionVertexFormat, numberOfVertices
);
- finalPositionVertices.SetData(
cat
);
+
VertexBuffer finalPositionVertices = VertexBuffer::New( finalPositionVertexFormat
);
+ finalPositionVertices.SetData(
cat, numberOfVertices
);
Property::Map colorVertexFormat;
colorVertexFormat["aColor"] = Property::VECTOR3;
Property::Map colorVertexFormat;
colorVertexFormat["aColor"] = Property::VECTOR3;
-
PropertyBuffer colorVertices = PropertyBuffer::New( colorVertexFormat, numberOfVertices
);
- colorVertices.SetData(
colors
);
+
VertexBuffer colorVertices = VertexBuffer::New( colorVertexFormat
);
+ colorVertices.SetData(
colors, numberOfVertices
);
// Create the geometry object
Geometry texturedQuadGeometry = Geometry::New();
// Create the geometry object
Geometry texturedQuadGeometry = Geometry::New();
@@
-281,41
+281,36
@@
public:
*/
void Create( Application& application )
{
*/
void Create( Application& application )
{
-
Stage stage = Stage::GetCurrent
();
-
stage
.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);
+
Window window = application.GetWindow
();
+
window
.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent);
- m
StageSize = stage
.GetSize();
+ m
WindowSize = window
.GetSize();
// The Init signal is received once (only) during the Application lifetime
// The Init signal is received once (only) during the Application lifetime
- // Hide the indicator bar
- application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
-
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
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 = 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( "uDelta", 0.f );
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
Property::Index morphDeltaIndex = mMeshActor.RegisterProperty( "uDelta", 0.f );
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor.SetP
arentOrigin(
ParentOrigin::CENTER );
- mMeshActor.Set
AnchorPoint(
AnchorPoint::CENTER );
-
stage
.Add( mMeshActor );
+ mMeshActor.SetP
roperty( Actor::Property::PARENT_ORIGIN,
ParentOrigin::CENTER );
+ mMeshActor.Set
Property( Actor::Property::ANCHOR_POINT,
AnchorPoint::CENTER );
+
window
.Add( mMeshActor );
Animation animation = Animation::New(10);
animation.AnimateTo( Property( mMeshActor, morphDeltaIndex ), 1.f, StationarySin );
animation.SetLooping( true );
animation.Play();
Animation animation = Animation::New(10);
animation.AnimateTo( Property( mMeshActor, morphDeltaIndex ), 1.f, StationarySin );
animation.SetLooping( true );
animation.Play();
-
stage
.SetBackgroundColor(Vector4(0.0f, 0.2f, 0.2f, 1.0f));
+
window
.SetBackgroundColor(Vector4(0.0f, 0.2f, 0.2f, 1.0f));
}
/**
}
/**
@@
-343,30
+338,19
@@
public:
private:
Application& mApplication; ///< Application instance
private:
Application& mApplication; ///< Application instance
- Vector3 m
StageSize; ///< The size of the stage
+ Vector3 m
WindowSize; ///< The size of the window
Shader mShader;
Shader mShader;
- Material mMaterial;
Geometry mGeometry;
Renderer mRenderer;
Actor mMeshActor;
Timer mMorphTimer;
};
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 );
ExampleController test( application );
-
application.MainLoop();
application.MainLoop();
-}
-
-// Entry point for Linux & SLP applications
-//
-int main( int argc, char **argv )
-{
- Application application = Application::New( &argc, &argv );
-
- RunTest( application );
-
return 0;
}
return 0;
}