diff --git a/demo/dali-table-view.cpp b/demo/dali-table-view.cpp index 7f60345..00e1c7f 100644 --- a/demo/dali-table-view.cpp +++ b/demo/dali-table-view.cpp @@ -299,8 +299,6 @@ void DaliTableView::Initialize( Application& application ) unsigned int degrees = 0; Rotate( degrees ); - //orientation.ChangedSignal().Connect( this, &DaliTableView::OrientationChanged ); - winHandle.ShowIndicator( Dali::Window::INVISIBLE ); // Background animation @@ -415,11 +413,6 @@ void DaliTableView::Populate() mScrollView.SetRulerY( mScrollRulerY ); } -void DaliTableView::OrientationChanged( Orientation orientation ) -{ - // TODO: Implement if orientation change required -} - void DaliTableView::Rotate( unsigned int degrees ) { // Resize the root actor diff --git a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp index 99fe02e..a5782ef 100644 --- a/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp +++ b/examples/image-scaling-and-filtering/image-scaling-and-filtering-example.cpp @@ -178,11 +178,11 @@ public: // Background image: Dali::Property::Map backgroundImage; backgroundImage.Insert( "rendererType", "image" ); - backgroundImage.Insert( "imageUrl", BACKGROUND_IMAGE ); - backgroundImage.Insert( "imageDesiredWidth", stage.GetSize().width ); - backgroundImage.Insert( "imageDesiredHeight", stage.GetSize().height ); - backgroundImage.Insert( "imageFittingMode", "scaleToFill" ); - backgroundImage.Insert( "imageSamplingMode", "boxThenNearest" ); + backgroundImage.Insert( "url", BACKGROUND_IMAGE ); + backgroundImage.Insert( "desiredWidth", stage.GetSize().width ); + backgroundImage.Insert( "desiredHeight", stage.GetSize().height ); + backgroundImage.Insert( "fittingMode", "SCALE_TO_FILL" ); + backgroundImage.Insert( "samplingMode", "BOX_THEN_NEAREST" ); Toolkit::ImageView background = Toolkit::ImageView::New(); background.SetProperty( Toolkit::ImageView::Property::IMAGE, backgroundImage ); diff --git a/examples/item-view/item-view-example.cpp b/examples/item-view/item-view-example.cpp index 2c4060b..aeb1d2e 100644 --- a/examples/item-view/item-view-example.cpp +++ b/examples/item-view/item-view-example.cpp @@ -209,8 +209,6 @@ public: TOOLBAR_IMAGE, "" ); - //app.GetWindow().GetOrientation().ChangedSignal().Connect( this, &ItemViewExample::OnOrientationChanged ); - // Create an edit mode button. (left of toolbar) Toolkit::PushButton editButton = Toolkit::PushButton::New(); editButton.SetUnselectedImage( EDIT_IMAGE ); @@ -380,24 +378,6 @@ public: mItemView.ActivateLayout( layoutId, Vector3(stageSize.x, stageSize.y, stageSize.x), 0.0f ); } - /** - * Orientation changed signal callback - * @param orientation - */ - void OnOrientationChanged( Orientation orientation ) - { - const unsigned int angle = orientation.GetDegrees(); - - // If orientation really changed - if( mOrientation != angle ) - { - // Remember orientation - mOrientation = angle; - - SetLayout( mCurrentLayout ); - } - } - bool OnLayoutButtonClicked( Toolkit::Button button ) { // Switch to the next layout diff --git a/examples/line-mesh/line-mesh-example.cpp b/examples/line-mesh/line-mesh-example.cpp index 5c8779b..79814a1 100644 --- a/examples/line-mesh/line-mesh-example.cpp +++ b/examples/line-mesh/line-mesh-example.cpp @@ -22,6 +22,8 @@ // INTERNAL INCLUDES #include "shared/view.h" +#include + using namespace Dali; namespace @@ -62,43 +64,11 @@ void main() } ); -PropertyBuffer CreateIndexBuffer( Geometry::GeometryType geometryType ) -{ - // Create indices - const unsigned int indexDataLines[] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 0 }; - const unsigned int indexDataLoops[] = { 0, 1, 2, 3, 4 }; - const unsigned int indexDataStrips[] = { 0, 1, 2, 3, 4, 0 }; - - // Create index buffer if doesn't exist - Property::Map indexFormat; - indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat ); - - // Update buffer - switch( geometryType ) - { - case Geometry::LINES: - { - indices.SetData( indexDataLines, sizeof(indexDataLines)/sizeof(indexDataLines[0]) ); - break; - } - case Geometry::LINE_LOOP: - { - indices.SetData( indexDataLoops, sizeof(indexDataLoops)/sizeof(indexDataLoops[0]) ); - break; - } - case Geometry::LINE_STRIP: - { - indices.SetData( indexDataStrips, sizeof(indexDataStrips)/sizeof(indexDataStrips[0]) ); - break; - } - default: // this will never happen, but compilers yells - { - } - } - - return indices; -} +const unsigned short INDEX_LINES[] = { 0, 1, 1, 2, 2, 3, 3, 4, 4, 0 }; +const unsigned short INDEX_LOOP[] = { 0, 1, 2, 3, 4 }; +const unsigned short INDEX_STRIP[] = { 0, 1, 2, 3, 4, 0 }; +const unsigned short* INDICES[3] = { &INDEX_LINES[0], &INDEX_LOOP[0], &INDEX_STRIP[0] }; +const unsigned int INDICES_SIZE[3] = { sizeof(INDEX_LINES)/sizeof(INDEX_LINES[0]), sizeof(INDEX_LOOP)/sizeof(INDEX_LOOP[0]), sizeof(INDEX_STRIP)/sizeof(INDEX_STRIP[0])}; Geometry CreateGeometry() { @@ -127,13 +97,11 @@ Geometry CreateGeometry() PropertyBuffer pentagonVertices = PropertyBuffer::New( pentagonVertexFormat ); pentagonVertices.SetData(pentagonVertexData, 5); - // Create indices - PropertyBuffer indices = CreateIndexBuffer( Geometry::LINES ); // Create the geometry object Geometry pentagonGeometry = Geometry::New(); pentagonGeometry.AddVertexBuffer( pentagonVertices ); - pentagonGeometry.SetIndexBuffer( indices ); + pentagonGeometry.SetIndexBuffer( INDICES[0], INDICES_SIZE[0] ); pentagonGeometry.SetGeometryType( Geometry::LINES ); return pentagonGeometry; } @@ -173,14 +141,18 @@ public: { Stage stage = Stage::GetCurrent(); + // initial settings + mPrimitiveType = Geometry::LINES; + mCurrentIndexCount = 10; + mMaxIndexCount = 10; + CreateRadioButtons(); stage.KeyEventSignal().Connect(this, &ExampleController::OnKeyEvent); mStageSize = stage.GetSize(); - // The Init signal is received once (only) during the Application lifetime - ReInitialise( Geometry::LINES ); + Initialise(); // Hide the indicator bar application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE ); @@ -190,9 +162,8 @@ public: /** * Invoked whenever application changes the type of geometry drawn - * @param[in] type of geometry */ - void ReInitialise( Geometry::GeometryType geometryType ) + void Initialise() { Stage stage = Stage::GetCurrent(); @@ -207,6 +178,9 @@ public: mGeometry = CreateGeometry(); mRenderer = Renderer::New( mGeometry, mShader ); + mRenderer.SetIndexRange( 0, 10 ); // lines + mPrimitiveType = Geometry::LINES; + mMeshActor = Actor::New(); mMeshActor.AddRenderer( mRenderer ); mMeshActor.SetSize(200, 200); @@ -236,14 +210,14 @@ public: { Stage stage = Stage::GetCurrent(); - Toolkit::TableView modeSelectTableView = Toolkit::TableView::New( 3, 1 ); + Toolkit::TableView modeSelectTableView = Toolkit::TableView::New( 4, 1 ); modeSelectTableView.SetParentOrigin( ParentOrigin::TOP_LEFT ); modeSelectTableView.SetAnchorPoint( AnchorPoint::TOP_LEFT ); modeSelectTableView.SetFitHeight( 0 ); modeSelectTableView.SetFitHeight( 1 ); modeSelectTableView.SetFitHeight( 2 ); modeSelectTableView.SetCellPadding( Vector2( 6.0f, 0.0f ) ); - modeSelectTableView.SetScale( Vector3( 0.5f, 0.5f, 0.5f )); + modeSelectTableView.SetScale( Vector3( 0.8f, 0.8f, 0.8f )); const char* labels[] = { @@ -268,7 +242,46 @@ public: mButtons[i] = radio; modeSelectTableView.AddChild( radio, Toolkit::TableView::CellPosition( i, 0 ) ); } + + Toolkit::TableView elementCountTableView = Toolkit::TableView::New( 1, 3 ); + elementCountTableView.SetCellPadding( Vector2( 6.0f, 0.0f ) ); + elementCountTableView.SetParentOrigin( ParentOrigin::BOTTOM_LEFT ); + elementCountTableView.SetAnchorPoint( AnchorPoint::BOTTOM_LEFT ); + elementCountTableView.SetFitHeight( 0 ); + elementCountTableView.SetFitWidth( 0 ); + elementCountTableView.SetFitWidth( 1 ); + elementCountTableView.SetFitWidth( 2 ); + mMinusButton = Toolkit::PushButton::New(); + mMinusButton.SetLabelText( "<<" ); + mMinusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); + mMinusButton.SetAnchorPoint( AnchorPoint::CENTER_LEFT ); + + Toolkit::PushButton mPlusButton = Toolkit::PushButton::New(); + mPlusButton.SetLabelText( ">>" ); + mPlusButton.SetParentOrigin( ParentOrigin::TOP_LEFT ); + mPlusButton.SetAnchorPoint( AnchorPoint::CENTER_RIGHT ); + + mMinusButton.ClickedSignal().Connect( this, &ExampleController::OnButtonClicked ); + mPlusButton.ClickedSignal().Connect( this, &ExampleController::OnButtonClicked ); + + mIndicesCountLabel = Toolkit::TextLabel::New(); + mIndicesCountLabel.SetParentOrigin( ParentOrigin::CENTER ); + mIndicesCountLabel.SetAnchorPoint( AnchorPoint::TOP_LEFT ); + + std::stringstream str; + str << mCurrentIndexCount; + mIndicesCountLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, str.str() ); + mIndicesCountLabel.SetProperty( Toolkit::TextLabel::Property::TEXT_COLOR, Vector4( 1.0, 1.0, 1.0, 1.0 ) ); + mIndicesCountLabel.SetProperty( Toolkit::TextLabel::Property::VERTICAL_ALIGNMENT, "BOTTOM"); + mIndicesCountLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::WIDTH ); + mIndicesCountLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::HEIGHT ); + + elementCountTableView.AddChild( mMinusButton, Toolkit::TableView::CellPosition( 0, 0 ) ); + elementCountTableView.AddChild( mIndicesCountLabel, Toolkit::TableView::CellPosition( 0, 1 ) ); + elementCountTableView.AddChild( mPlusButton, Toolkit::TableView::CellPosition( 0, 2 ) ); + stage.Add(modeSelectTableView); + stage.Add(elementCountTableView); } /** @@ -295,35 +308,57 @@ public: bool OnButtonPressed( Toolkit::Button button ) { - const Geometry::GeometryType geomTypes[] = - { - Geometry::LINES, - Geometry::LINE_LOOP, - Geometry::LINE_STRIP - }; - - size_t index; + int indicesArray; if( button == mButtons[0] ) { - index = 0; + mCurrentIndexCount = 10; + mMaxIndexCount = 10; + mPrimitiveType = Geometry::LINES; + indicesArray = 0; } else if( button == mButtons[1] ) { - index = 1; + mCurrentIndexCount = 5; + mMaxIndexCount = 5; + mPrimitiveType = Geometry::LINE_LOOP; + indicesArray = 1; } else { - index = 2; + mCurrentIndexCount = 6; + mMaxIndexCount = 6; + mPrimitiveType = Geometry::LINE_STRIP; + indicesArray = 2; } - PropertyBuffer indices = CreateIndexBuffer( geomTypes[ index ] ); - mGeometry.SetIndexBuffer( indices ); - mGeometry.SetGeometryType( geomTypes[ index ] ); - + std::stringstream str; + str << mCurrentIndexCount; + mIndicesCountLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, str.str() ); + mGeometry.SetGeometryType( mPrimitiveType ); + mGeometry.SetIndexBuffer( INDICES[ indicesArray ], INDICES_SIZE[ indicesArray ] ); + mRenderer.SetIndexRange( 0, mCurrentIndexCount ); return true; } + bool OnButtonClicked( Toolkit::Button button ) + { + if( button == mMinusButton ) + { + if (--mCurrentIndexCount < 2 ) + mCurrentIndexCount = 2; + } + else + { + if (++mCurrentIndexCount > mMaxIndexCount ) + mCurrentIndexCount = mMaxIndexCount; + } + std::stringstream str; + str << mCurrentIndexCount; + mIndicesCountLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, str.str() ); + mRenderer.SetIndexRange( 0, mCurrentIndexCount ); + return true; + } private: @@ -334,7 +369,13 @@ private: Geometry mGeometry; Renderer mRenderer; Actor mMeshActor; - Toolkit::RadioButton mButtons[3]; + Toolkit::RadioButton mButtons[3]; + Toolkit::PushButton mMinusButton; + Toolkit::PushButton mPlusButton; + Toolkit::TextLabel mIndicesCountLabel; + Geometry::GeometryType mPrimitiveType; + int mCurrentIndexCount; + int mMaxIndexCount; }; void RunTest( Application& application ) diff --git a/examples/mesh-sorting/mesh-sorting-example.cpp b/examples/mesh-sorting/mesh-sorting-example.cpp index 95c091d..28d7f9f 100644 --- a/examples/mesh-sorting/mesh-sorting-example.cpp +++ b/examples/mesh-sorting/mesh-sorting-example.cpp @@ -102,16 +102,12 @@ Geometry CreateGeometry() texturedQuadVertices.SetData( texturedQuadVertexData, 4 ); // Create indices - unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 }; - Property::Map indexFormat; - indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat ); - indices.SetData( indexData, 6 ); + unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 }; // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); texturedQuadGeometry.AddVertexBuffer( texturedQuadVertices ); - texturedQuadGeometry.SetIndexBuffer( indices ); + texturedQuadGeometry.SetIndexBuffer( &indexData[0], sizeof(indexData)/sizeof(unsigned short) ); return texturedQuadGeometry; } diff --git a/examples/metaball-explosion/metaball-explosion-example.cpp b/examples/metaball-explosion/metaball-explosion-example.cpp index 07f57c3..39519b8 100644 --- a/examples/metaball-explosion/metaball-explosion-example.cpp +++ b/examples/metaball-explosion/metaball-explosion-example.cpp @@ -373,8 +373,6 @@ Geometry MetaballExplosionController::CreateGeometry() { Vector2(1.0f, 1.0f * aspect) } }; - int indices[] = { 0, 3, 1, 0, 2, 3 }; - unsigned int numberOfVertices = sizeof(vertices)/sizeof(VertexPosition); //Vertices @@ -390,17 +388,14 @@ Geometry MetaballExplosionController::CreateGeometry() textureVertices.SetData( textures, numberOfVertices ); //Indices - Property::Map indicesVertexFormat; - indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); - indicesToVertices.SetData( indices, 6 ); + unsigned short indices[] = { 0, 3, 1, 0, 2, 3 }; // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); texturedQuadGeometry.AddVertexBuffer( positionVertices ); texturedQuadGeometry.AddVertexBuffer( textureVertices ); - texturedQuadGeometry.SetIndexBuffer ( indicesToVertices ); + texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) ); return texturedQuadGeometry; } @@ -431,8 +426,6 @@ Geometry MetaballExplosionController::CreateGeometryComposition() { Vector2(1.0f, 1.0f) } }; - int indices[] = { 0, 3, 1, 0, 2, 3 }; - unsigned int numberOfVertices = sizeof(vertices)/sizeof(VertexPosition); //Vertices @@ -448,17 +441,14 @@ Geometry MetaballExplosionController::CreateGeometryComposition() textureVertices.SetData( textures, numberOfVertices ); //Indices - Property::Map indicesVertexFormat; - indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); - indicesToVertices.SetData( indices, 6 ); + unsigned short indices[] = { 0, 3, 1, 0, 2, 3 }; // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); texturedQuadGeometry.AddVertexBuffer( positionVertices ); texturedQuadGeometry.AddVertexBuffer( textureVertices ); - texturedQuadGeometry.SetIndexBuffer ( indicesToVertices ); + texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) ); return texturedQuadGeometry; } diff --git a/examples/metaball-refrac/metaball-refrac-example.cpp b/examples/metaball-refrac/metaball-refrac-example.cpp index 46bf2b0..995977c 100644 --- a/examples/metaball-refrac/metaball-refrac-example.cpp +++ b/examples/metaball-refrac/metaball-refrac-example.cpp @@ -322,8 +322,6 @@ Geometry MetaballRefracController::CreateGeometry() { Vector3(0.0f, 0.0f, 1.0f) } }; - int indices[] = { 0, 3, 1, 0, 2, 3 }; - unsigned int numberOfVertices = sizeof(vertices)/sizeof(VertexPosition); //Vertices @@ -345,11 +343,7 @@ Geometry MetaballRefracController::CreateGeometry() normalVertices.SetData( normals, numberOfVertices ); //Indices - Property::Map indicesVertexFormat; - indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); - indicesToVertices.SetData( indices, 6 ); - + unsigned short indices[] = { 0, 3, 1, 0, 2, 3 }; // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); @@ -357,7 +351,7 @@ Geometry MetaballRefracController::CreateGeometry() texturedQuadGeometry.AddVertexBuffer( textureVertices ); texturedQuadGeometry.AddVertexBuffer( normalVertices ); - texturedQuadGeometry.SetIndexBuffer ( indicesToVertices ); + texturedQuadGeometry.SetIndexBuffer ( &indices[0], 6 ); return texturedQuadGeometry; } @@ -398,8 +392,6 @@ Geometry MetaballRefracController::CreateGeometryComposition() { Vector3(0.0f, 0.0f, 1.0f) } }; - int indices[] = { 0, 3, 1, 0, 2, 3 }; - unsigned int numberOfVertices = sizeof(vertices)/sizeof(VertexPosition); //Vertices @@ -421,10 +413,7 @@ Geometry MetaballRefracController::CreateGeometryComposition() normalVertices.SetData( normals, numberOfVertices ); //Indices - Property::Map indicesVertexFormat; - indicesVertexFormat["aIndices"] = Property::INTEGER; - PropertyBuffer indicesToVertices = PropertyBuffer::New( indicesVertexFormat ); - indicesToVertices.SetData( indices, 6 ); + unsigned short indices[] = { 0, 3, 1, 0, 2, 3 }; // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); @@ -432,7 +421,7 @@ Geometry MetaballRefracController::CreateGeometryComposition() texturedQuadGeometry.AddVertexBuffer( textureVertices ); texturedQuadGeometry.AddVertexBuffer( normalVertices ); - texturedQuadGeometry.SetIndexBuffer ( indicesToVertices ); + texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) ); return texturedQuadGeometry; } diff --git a/examples/motion-blur/motion-blur-example.cpp b/examples/motion-blur/motion-blur-example.cpp index 33972b1..37b0626 100644 --- a/examples/motion-blur/motion-blur-example.cpp +++ b/examples/motion-blur/motion-blur-example.cpp @@ -193,7 +193,6 @@ public: winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); // set initial orientation - // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionBlurExampleApp::OnOrientationChanged ); unsigned int degrees = 0; Rotate( static_cast< DeviceOrientation >( degrees ) ); @@ -289,18 +288,6 @@ public: #endif //#ifdef MULTIPLE_MOTION_BLURRED_ACTORS } - ////////////////////////////////////////////////////////////// - // - // Device Orientation Support - // - // - - void OnOrientationChanged( Orientation orientation ) - { - unsigned int degrees = orientation.GetDegrees(); - Rotate( static_cast< DeviceOrientation >( degrees ) ); - } - void Rotate( DeviceOrientation orientation ) { // Resize the root actor diff --git a/examples/motion-stretch/motion-stretch-example.cpp b/examples/motion-stretch/motion-stretch-example.cpp index 9a04340..b055b4f 100644 --- a/examples/motion-stretch/motion-stretch-example.cpp +++ b/examples/motion-stretch/motion-stretch-example.cpp @@ -167,7 +167,6 @@ public: winHandle.AddAvailableOrientation( Dali::Window::PORTRAIT_INVERSE ); winHandle.AddAvailableOrientation( Dali::Window::LANDSCAPE_INVERSE ); - // winHandle.GetOrientation().ChangedSignal().Connect( this, &MotionStretchExampleApp::OnOrientationChanged ); unsigned int degrees = 0; Rotate( static_cast< DeviceOrientation >( degrees ) ); @@ -196,12 +195,6 @@ public: // // - void OnOrientationChanged( Orientation orientation ) - { - unsigned int degrees = orientation.GetDegrees(); - Rotate( static_cast< DeviceOrientation >( degrees ) ); - } - void Rotate( DeviceOrientation orientation ) { // Resize the root actor diff --git a/examples/new-window/new-window-example.cpp b/examples/new-window/new-window-example.cpp index d1ea946..022c15a 100644 --- a/examples/new-window/new-window-example.cpp +++ b/examples/new-window/new-window-example.cpp @@ -450,16 +450,12 @@ Geometry NewWindowController::CreateMeshGeometry() vertices.SetData( vertexData, 5 ); // Specify all the faces - unsigned int indexData[12] = { 0,1,3,0,2,4,0,3,4,0,2,1 }; - Property::Map indexFormat; - indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat ); - indices.SetData( indexData, 12 ); + unsigned short indexData[12] = { 0,1,3,0,2,4,0,3,4,0,2,1 }; // Create the geometry object Geometry geometry = Geometry::New(); geometry.AddVertexBuffer( vertices ); - geometry.SetIndexBuffer( indices ); + geometry.SetIndexBuffer( &indexData[0], 12 ); return geometry; } diff --git a/examples/radial-menu/radial-sweep-view-impl.cpp b/examples/radial-menu/radial-sweep-view-impl.cpp index c072f58..495e2ec 100644 --- a/examples/radial-menu/radial-sweep-view-impl.cpp +++ b/examples/radial-menu/radial-sweep-view-impl.cpp @@ -330,15 +330,11 @@ void RadialSweepViewImpl::CreateStencil( Radian initialSector ) PropertyBuffer vertices = PropertyBuffer::New( vertexFormat ); vertices.SetData( vertexData, 7u ); - unsigned int indexData[15] = { 0,1,2,0,2,3,0,3,4,0,4,5,0,5,6 }; - Property::Map indexFormat; - indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat ); - indices.SetData( indexData, 15u ); + unsigned short indexData[15] = { 0,1,2,0,2,3,0,3,4,0,4,5,0,5,6 }; Geometry meshGeometry = Geometry::New(); meshGeometry.AddVertexBuffer( vertices ); - meshGeometry.SetIndexBuffer( indices ); + meshGeometry.SetIndexBuffer( &indexData[0], sizeof( indexData )/sizeof(indexData[0]) ); // Create shader std::ostringstream vertexShaderStringStream; diff --git a/examples/textured-mesh/textured-mesh-example.cpp b/examples/textured-mesh/textured-mesh-example.cpp index b445fcc..1de4316 100644 --- a/examples/textured-mesh/textured-mesh-example.cpp +++ b/examples/textured-mesh/textured-mesh-example.cpp @@ -79,16 +79,12 @@ Geometry CreateGeometry() texturedQuadVertices.SetData( texturedQuadVertexData, 4 ); // Create indices - unsigned int indexData[6] = { 0, 3, 1, 0, 2, 3 }; - Property::Map indexFormat; - indexFormat["indices"] = Property::INTEGER; - PropertyBuffer indices = PropertyBuffer::New( indexFormat ); - indices.SetData( indexData, sizeof(indexData)/sizeof(indexData[0]) ); + unsigned short indexData[6] = { 0, 3, 1, 0, 2, 3 }; // Create the geometry object Geometry texturedQuadGeometry = Geometry::New(); texturedQuadGeometry.AddVertexBuffer( texturedQuadVertices ); - texturedQuadGeometry.SetIndexBuffer( indices ); + texturedQuadGeometry.SetIndexBuffer( &indexData[0], sizeof(indexData)/sizeof(indexData[0]) ); return texturedQuadGeometry; } diff --git a/packaging/com.samsung.dali-demo.spec b/packaging/com.samsung.dali-demo.spec index e1ca0e5..8f25a19 100755 --- a/packaging/com.samsung.dali-demo.spec +++ b/packaging/com.samsung.dali-demo.spec @@ -2,7 +2,7 @@ Name: com.samsung.dali-demo Summary: The OpenGLES Canvas Core Demo -Version: 1.1.31 +Version: 1.1.32 Release: 1 Group: System/Libraries License: Apache-2.0 diff --git a/resources/scripts/animation.json b/resources/scripts/animation.json index 0b304bc..f2bb9a3 100644 --- a/resources/scripts/animation.json +++ b/resources/scripts/animation.json @@ -118,9 +118,9 @@ "text": "or the image.." }, { "name": "image", - "type": "ImageActor", + "type": "ImageView", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-large-21.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-large-21.jpg" }, "relayoutEnabled": false, "position": [0, 200, 0], diff --git a/resources/scripts/background.json b/resources/scripts/background.json index 62ffd08..365289c 100644 --- a/resources/scripts/background.json +++ b/resources/scripts/background.json @@ -45,8 +45,8 @@ "heightResizePolicy":"SIZE_RELATIVE_TO_PARENT", "sizeModeFactor": [ 0.5, 0.333333333333, 1 ], "background": { - "rendererType": "svg", - "imageUrl": "{DEMO_IMAGE_DIR}Kid1.svg" + "rendererType": "image", + "url": "{DEMO_IMAGE_DIR}Kid1.svg" } }, @@ -77,7 +77,7 @@ "sizeModeFactor": [ 0.5, 0.333333333333, 1 ], "background": { "rendererType": "image", - "imageUrl": "{DEMO_IMAGE_DIR}gallery-large-9.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-large-9.jpg" } }, diff --git a/resources/scripts/shader-effect-ripple.json b/resources/scripts/shader-effect-ripple.json index 06a0c1d..aabc376 100644 --- a/resources/scripts/shader-effect-ripple.json +++ b/resources/scripts/shader-effect-ripple.json @@ -1,7 +1,7 @@ { "stage": [ { - "type": "ImageActor", + "type": "ImageView", "name": "Image1", "position": [ 0.40461349487305, @@ -11,13 +11,17 @@ "parentOrigin": [0.5, 0.5, 0.5], "widthResizePolicy":"FILL_TO_PARENT", "heightResizePolicy":"DIMENSION_DEPENDENCY", - "effect": "Ripple2D", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-medium-25.jpg", - "width": 400, - "height": 400, - "loadPolicy": "IMMEDIATE", - "releasePolicy": "NEVER" + "url": "{DEMO_IMAGE_DIR}gallery-medium-25.jpg", + "desiredWidth": 400, + "desiredHeight": 400, + "shader": { + "fragmentShader": "precision mediump float;\nuniform sampler2D sTexture;\nuniform vec4 uColor;\nuniform float uAmplitude;\nuniform float uTime;\nvarying vec2 vTexCoord;\nvoid main()\n{\n highp vec2 pos = -1.0 + 2.0 * vTexCoord;\n highp float len = length(pos);\n highp vec2 texCoord = vTexCoord + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude;\n gl_FragColor = texture2D(sTexture, texCoord) * uColor;}\n\n" + } + }, + "animatableProperties": { + "uAmplitude": 0.02, + "uTime": 0.0 }, "signals": [ { @@ -28,7 +32,6 @@ ] } ], - "paths": {}, "animations": { "Animation_1": { "loop":true, @@ -46,21 +49,5 @@ } ] } - }, - "shaderEffects": { - "Ripple2D": { - "program": { - "vertexPrefix": "", - "vertex": "void main(void)\n{\n gl_Position = uMvpMatrix * vec4(aPosition, 1.0);\n vTexCoord = mix( sTextureRect.xy, sTextureRect.zw, aTexCoord );\n}\n\n", - "fragmentPrefix": "", - "fragment": "precision mediump float;\nuniform float uAmplitude; // 0.02; (< 1)\nuniform float uTime;\nvoid main()\n{\n highp vec2 textureSize = sTextureRect.zw - sTextureRect.xy;\n highp vec2 pos = -1.0 + 2.0 * vTexCoord.st/textureSize;\n highp float len = length(pos);\n highp vec2 texCoord = vTexCoord.st/textureSize + pos/len * sin( len * 12.0 - uTime * 4.0 ) * uAmplitude; \n gl_FragColor = texture2D(sTexture, texCoord) * uColor;\n}\n\n\n", - "geometryType": "GEOMETRY_TYPE_IMAGE" - }, - "geometryHints": "HINT_NONE", - "gridDensity": 0, - "loop": true, - "uAmplitude": 0.02, - "uTime": 0.0 - } } } diff --git a/resources/scripts/table-view.json b/resources/scripts/table-view.json index ff46cd1..075cb8f 100644 --- a/resources/scripts/table-view.json +++ b/resources/scripts/table-view.json @@ -63,34 +63,34 @@ }, "actors": [{ "name":"gallery1", - "type":"ImageActor", + "type":"ImageView", "heightResizePolicy":"FILL_TO_PARENT", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-small-1.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-small-1.jpg" }, - "customProperties": { // properties registered dynamically + "properties": { // properties registered dynamically "cellIndex": [0,0], // property to specify the top-left cell this child occupies "rowSpan":4, // property to specify how many rows this child occupies, if not set, default value is 1 "columnSpan":1 // property to specify how many columns this child occupies, if nor set, defualt cvalue is 1 } },{ "name":"gallery2", - "type":"ImageActor", + "type":"ImageView", "heightResizePolicy":"FILL_TO_PARENT", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-small-2.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-small-2.jpg" }, - "customProperties": { // properties registered dynamically + "properties": { // properties registered dynamically "cellIndex": [0,1], "cellHorizontalAlignment": "right" // property to specify how to align horizontally inside the cells, if not set, default value is 'left' } },{ "name":"gallery3", - "type":"ImageActor", + "type":"ImageView", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-small-3.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-small-3.jpg" }, - "customProperties": { + "properties": { "cellIndex":[1,1], "rowSpan":3, "cellHorizontalAlignment": "left",// property to specify how to align horizontally inside the cells, if not set, default value is 'left' @@ -98,23 +98,23 @@ } }, { "name":"gallery4", - "type":"ImageActor", + "type":"ImageView", "widthResizePolicy":"FILL_TO_PARENT", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-small-4.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-small-4.jpg" }, - "customProperties": { + "properties": { "cellIndex":[2,2] } }, { "name":"gallery5", - "type":"ImageActor", + "type":"ImageView", "widthResizePolicy":"FILL_TO_PARENT", "heightResizePolicy":"FILL_TO_PARENT", "image": { - "filename": "{DEMO_IMAGE_DIR}gallery-small-5.jpg" + "url": "{DEMO_IMAGE_DIR}gallery-small-5.jpg" }, - "customProperties": { + "properties": { "cellIndex":[3,2], "columnSpan": 2 } diff --git a/shared/view.h b/shared/view.h index 3ac52a6..6af3324 100644 --- a/shared/view.h +++ b/shared/view.h @@ -20,7 +20,6 @@ #include #include -#include namespace DemoHelper