/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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/public-api/rendering/renderer.h>
#include <dali-toolkit/dali-toolkit.h>
// INTERNAL INCLUDES
// Respond to a click anywhere on the stage
stage.GetRootLayer().TouchSignal().Connect( this, &Benchmark::OnTouch );
+ // Respond to key events
+ stage.KeyEventSignal().Connect( this, &Benchmark::OnKeyEvent );
+
if( gUseMesh )
{
CreateMeshActors();
float delay = 0.0f;
float duration = 0.0f;
- if( count < mRowsPerPage*mColumnsPerPage )
+ if( count < ( static_cast< size_t >( mRowsPerPage ) * mColumnsPerPage ) )
{
duration = durationPerActor;
delay = delayBetweenActors * count;
Vector3 stageSize( stage.GetSize() );
mScroll = Animation::New(10.0f);
- size_t actorCount( mRowsPerPage*mColumnsPerPage*mPageCount);
+ size_t actorCount( static_cast< size_t >( mRowsPerPage ) * mColumnsPerPage * mPageCount );
for( size_t i(0); i<actorCount; ++i )
{
if( gUseMesh )
mHide.FinishedSignal().Connect( this, &Benchmark::OnAnimationEnd );
}
+ void OnKeyEvent( const KeyEvent& event )
+ {
+ if( event.state == KeyEvent::Down )
+ {
+ if ( IsKey( event, Dali::DALI_KEY_ESCAPE ) || IsKey( event, Dali::DALI_KEY_BACK ) )
+ {
+ mApplication.Quit();
+ }
+ }
+ }
+
private:
Application& mApplication;
Animation mHide;
};
-void RunTest( Application& application )
-{
- Benchmark test( application );
-
- application.MainLoop();
-}
-
-// Entry point for Linux & Tizen applications
-//
int DALI_EXPORT_API main( int argc, char **argv )
{
Application application = Application::New( &argc, &argv );
}
}
- RunTest( application );
+ Benchmark test( application );
+ application.MainLoop();
return 0;
}