double amplitudeFactor;
};
-namespace po = boost::program_options;
-
void glDisplayFunc();
void glReshapeFunc(int width, int height);
void glMouseFunc(int button, int state, int x, int y);
void glMotionFunc(int x, int y);
-Settings parseArguments(int argc, char** argv, po::options_description desc);
+Settings parseArguments(int argc, char** argv);
+
+namespace po = boost::program_options;
int main(int argc, char** argv)
{
- po::options_description desc("Available options");
- desc.add_options()
- ("help,h", "produce help message")
- ("windspeed,w", po::value<double>()->default_value(10),
- "wind speed given in m/s")
- ("size,s", po::value<std::string>()->default_value("small"),
- "lattice size (small/large)")
- ("amplitude,a", po::value<double>()->default_value(1),
- "amplitude multiplicator")
- ;
-
- Settings settings = parseArguments(argc, argv, desc);
+ Settings settings = parseArguments(argc, argv);
std::srand(std::time(0));
surface = std::make_shared<WaterSurface>(settings.latticeSize,
return 0;
}
-Settings parseArguments(int argc, char** argv, po::options_description desc)
+Settings parseArguments(int argc, char** argv)
{
+ po::options_description desc("Available options");
+ desc.add_options()
+ ("help,h", "produce help message")
+ ("windspeed,w", po::value<double>()->default_value(10),
+ "wind speed given in m/s")
+ ("size,s", po::value<std::string>()->default_value("small"),
+ "lattice size (small/large)")
+ ("amplitude,a", po::value<double>()->default_value(1),
+ "amplitude multiplicator")
+ ;
+
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);