/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
#include <sstream>
#include <algorithm>
#include <map>
+#include <random> // std::default_random_engine
+#include <chrono> // std::chrono::system_clock
#include "shared/utility.h"
#include "sparkle-effect.h"
*/
void OnInit( Application& application )
{
- Stage stage = Stage::GetCurrent();
- stage.KeyEventSignal().Connect(this, &SparkleEffectExample::OnKeyEvent);
- stage.SetBackgroundColor( BACKGROUND_COLOR );
+ Window window = application.GetWindow();
+ window.KeyEventSignal().Connect(this, &SparkleEffectExample::OnKeyEvent);
+ window.SetBackgroundColor( BACKGROUND_COLOR );
mCircleBackground = ImageView::New( CIRCLE_BACKGROUND_IMAGE );
mCircleBackground.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mCircleBackground.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
- stage.Add( mCircleBackground );
+ window.Add( mCircleBackground );
mEffect = SparkleEffect::New();
mMeshActor = CreateMeshActor();
- stage.Add( mMeshActor );
+ window.Add( mMeshActor );
mMeshActor.SetProperty( Actor::Property::POSITION, ACTOR_POSITION );
mMeshActor.SetProperty( Actor::Property::SCALE, ACTOR_SCALE );
{
shuffleArray[i] = i;
}
- std::random_shuffle(&shuffleArray[0],&shuffleArray[NUM_PARTICLE]);
+ const unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count();
+ std::shuffle(&shuffleArray[0],&shuffleArray[NUM_PARTICLE], std::default_random_engine(seed));
// Create vertices