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
Further Setter/Getter public API removal from Dali::Actor
[platform/core/uifw/dali-demo.git]
/
examples
/
point-mesh
/
point-mesh-example.cpp
diff --git
a/examples/point-mesh/point-mesh-example.cpp
b/examples/point-mesh/point-mesh-example.cpp
index
ce7a080
..
126b9d6
100644
(file)
--- a/
examples/point-mesh/point-mesh-example.cpp
+++ b/
examples/point-mesh/point-mesh-example.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
5
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,11
+16,11
@@
*/
// EXTERNAL INCLUDES
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
#include "shared/view.h"
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
#include "shared/view.h"
+#include "shared/utility.h"
using namespace Dali;
using namespace Dali;
@@
-82,7
+82,7
@@
Geometry CreateGeometry()
// Create vertices
struct Vertex { Vector2 position; float hue; };
// Create vertices
struct Vertex { Vector2 position; float hue; };
- unsigned int numSides = 20;
+
const
unsigned int numSides = 20;
Vertex polyhedraVertexData[numSides];
float angle=0;
float sectorAngle = 2.0f * Math::PI / (float) numSides;
Vertex polyhedraVertexData[numSides];
float angle=0;
float sectorAngle = 2.0f * Math::PI / (float) numSides;
@@
-98,13
+98,13
@@
Geometry CreateGeometry()
Property::Map polyhedraVertexFormat;
polyhedraVertexFormat["aPosition"] = Property::VECTOR2;
polyhedraVertexFormat["aHue"] = Property::FLOAT;
Property::Map polyhedraVertexFormat;
polyhedraVertexFormat["aPosition"] = Property::VECTOR2;
polyhedraVertexFormat["aHue"] = Property::FLOAT;
- PropertyBuffer polyhedraVertices = PropertyBuffer::New( polyhedraVertexFormat
, numSides
);
- polyhedraVertices.SetData(
polyhedraVertexData
);
+ PropertyBuffer polyhedraVertices = PropertyBuffer::New( polyhedraVertexFormat );
+ polyhedraVertices.SetData(
polyhedraVertexData, numSides
);
// Create the geometry object
Geometry polyhedraGeometry = Geometry::New();
polyhedraGeometry.AddVertexBuffer( polyhedraVertices );
// Create the geometry object
Geometry polyhedraGeometry = Geometry::New();
polyhedraGeometry.AddVertexBuffer( polyhedraVertices );
- polyhedraGeometry.Set
Geometry
Type( Geometry::POINTS );
+ polyhedraGeometry.SetType( Geometry::POINTS );
return polyhedraGeometry;
}
return polyhedraGeometry;
}
@@
-152,22
+152,23
@@
public:
// Hide the indicator bar
application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
// Hide the indicator bar
application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
-
mImage = ResourceImage::New
( MATERIAL_SAMPLE );
-
Image image = ResourceImage::New
( MATERIAL_SAMPLE2 );
+
Texture texture0 = DemoHelper::LoadTexture
( MATERIAL_SAMPLE );
+
Texture texture1 = DemoHelper::LoadTexture
( MATERIAL_SAMPLE2 );
-
mS
hader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
+
Shader s
hader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
-
mMaterial = Material::New( mShader
);
-
mMaterial.AddTexture(mImage, "sTexture1"
);
-
mMaterial.AddTexture(image, "sTexture2"
);
+
TextureSet textureSet = TextureSet::New(
);
+
textureSet.SetTexture( 0u, texture0
);
+
textureSet.SetTexture( 1u, texture1
);
-
mG
eometry = CreateGeometry();
+
Geometry g
eometry = CreateGeometry();
- mRenderer = Renderer::New( mGeometry, mMaterial );
+ mRenderer = Renderer::New( geometry, shader );
+ mRenderer.SetTextures( textureSet );
mMeshActor = Actor::New();
mMeshActor.AddRenderer( mRenderer );
mMeshActor = Actor::New();
mMeshActor.AddRenderer( mRenderer );
- mMeshActor.Set
Size(400, 400
);
+ mMeshActor.Set
Property( Actor::Property::SIZE, Vector2(400, 400)
);
mMeshActor.RegisterProperty( "uFadeColor", Color::GREEN );
mMeshActor.RegisterProperty( "uFadeColor", Color::GREEN );
@@
-175,8
+176,8
@@
public:
mRenderer.RegisterProperty( "uPointSize", 80.0f );
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
mRenderer.RegisterProperty( "uPointSize", 80.0f );
mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, 0 );
- mMeshActor.SetP
arentOrigin(
ParentOrigin::CENTER );
- mMeshActor.Set
AnchorPoint(
AnchorPoint::CENTER );
+ mMeshActor.SetP
roperty( Actor::Property::PARENT_ORIGIN,
ParentOrigin::CENTER );
+ mMeshActor.Set
Property( Actor::Property::ANCHOR_POINT,
AnchorPoint::CENTER );
stage.Add( mMeshActor );
Animation animation = Animation::New(15);
stage.Add( mMeshActor );
Animation animation = Animation::New(15);
@@
-219,10
+220,6
@@
private:
Application& mApplication; ///< Application instance
Vector3 mStageSize; ///< The size of the stage
Application& mApplication; ///< Application instance
Vector3 mStageSize; ///< The size of the stage
- Image mImage;
- Shader mShader;
- Material mMaterial;
- Geometry mGeometry;
Renderer mRenderer;
Actor mMeshActor;
Renderer mRenderer2;
Renderer mRenderer;
Actor mMeshActor;
Renderer mRenderer2;
@@
-230,20
+227,10
@@
private:
Timer mChangeImageTimer;
};
Timer mChangeImageTimer;
};
-
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;
}