/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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/dali.h>
-#include <dali/devel-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <fstream>
#include <sstream>
public:
RefractionEffectExample( Application &application )
: mApplication( application ),
+ mContent(),
+ mTextureSet(),
+ mGeometry(),
+ mRenderer(),
+ mMeshActor(),
+ mShaderFlat(),
+ mShaderRefraction(),
+ mLightAnimation(),
+ mStrenghAnimation(),
+ mLightXYOffsetIndex( Property::INVALID_INDEX ),
+ mSpinAngleIndex( Property::INVALID_INDEX ),
+ mLightIntensityIndex( Property::INVALID_INDEX ),
+ mEffectStrengthIndex( Property::INVALID_INDEX ),
+ mChangeTextureButton(),
+ mChangeMeshButton(),
mCurrentTextureId( 1 ),
mCurrentMeshId( 0 )
{
// Add a button to change background. (right of toolbar)
mChangeTextureButton = Toolkit::PushButton::New();
- mChangeTextureButton.SetUnselectedImage( CHANGE_TEXTURE_ICON );
- mChangeTextureButton.SetSelectedImage( CHANGE_TEXTURE_ICON_SELECTED );
+ mChangeTextureButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_TEXTURE_ICON );
+ mChangeTextureButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_TEXTURE_ICON_SELECTED );
mChangeTextureButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeTexture );
toolBar.AddControl( mChangeTextureButton,
DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
// Add a button to change mesh pattern. ( left of bar )
mChangeMeshButton = Toolkit::PushButton::New();
- mChangeMeshButton.SetUnselectedImage( CHANGE_MESH_ICON );
- mChangeMeshButton.SetSelectedImage( CHANGE_MESH_ICON_SELECTED );
+ mChangeMeshButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, CHANGE_MESH_ICON );
+ mChangeMeshButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, CHANGE_MESH_ICON_SELECTED );
mChangeMeshButton.ClickedSignal().Connect( this, &RefractionEffectExample::OnChangeMesh );
toolBar.AddControl( mChangeMeshButton,
DemoHelper::DEFAULT_VIEW_STYLE.mToolBarButtonPercentage,
}
std::istringstream iss(line.substr(2), std::istringstream::in);
- unsigned int indices[ numOfInt ];
+
+ std::vector<unsigned int> indices( numOfInt );
+
unsigned int i=0;
while( iss >> indices[i++] && i < numOfInt);
unsigned int step = (i+1) / 3;
/*****************************************************************************/
-static void
-RunTest(Application& app)
-{
- RefractionEffectExample theApp(app);
- app.MainLoop();
-}
-
-/*****************************************************************************/
-
int DALI_EXPORT_API main(int argc, char **argv)
{
Application app = Application::New(&argc, &argv, DEMO_THEME_PATH);
-
- RunTest(app);
-
+ RefractionEffectExample theApp(app);
+ app.MainLoop();
return 0;
}