- Ubuntu 16.04 or later
- Environment created using dali_env script in dali-core repository
- - GCC version 6
-
-DALi requires a compiler supporting C++11 features.
-Ubuntu 16.04 is the first version to offer this by default (GCC v5.4.0).
+ - GCC version 9
-GCC version 6 is recommended since it has fixes for issues in version 5
-e.g. it avoids spurious 'defined but not used' warnings in header files.
+DALi requires a compiler supporting C++17 features.
### Building the Repository
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+SET(CMAKE_C_STANDARD 99)
PROJECT(dali-demo C CXX)
SET(dali-demo_VERSION_MAJOR 1)
IF( WIN32 )
ADD_COMPILE_OPTIONS( /FIdali-windows-dependencies.h ) # Adds missing definitions.
ADD_COMPILE_OPTIONS( /vmg ) # Avoids a 'reinterpret_cast' compile error while compiling signals and callbacks.
+ ADD_COMPILE_OPTIONS( /std:c++17 ) # c++17 support
ADD_COMPILE_OPTIONS( /wd4251 ) # Ignores warning C4251: "'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'"
ELSE()
+ ADD_COMPILE_OPTIONS( -std=c++17 ) # c++17 support
SET(DALI_DEMO_CFLAGS "${DALI_DEMO_CFLAGS} -Werror -Wall -fPIE")
IF( NOT ${ENABLE_EXPORTALL} )
#include <iostream>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
+#include <random> // std::default_random_engine
+#include <chrono> // std::chrono::system_clock
// INTERNAL INCLUDES
#include "grid-flags.h"
}
}
// Stir-up the list to get some nice irregularity in the generated field:
- std::random_shuffle( configurations.begin(), configurations.end() );
- std::random_shuffle( configurations.begin(), configurations.end() );
+ unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count();
+ std::shuffle( configurations.begin(), configurations.end(), std::default_random_engine(seed) );
+ seed = std::chrono::system_clock::now().time_since_epoch().count();
+ std::shuffle( configurations.begin(), configurations.end(), std::default_random_engine(seed) );
// Place the images in the grid:
#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"
{
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