+ // program options handling
+ po::options_description desc("Allowed options");
+ desc.add_options()
+ ("help,h", "produce help message")
+ ("swap-interval,i", po::value<int>(), "set swap interval")
+ ("copy,c", "copy to front buffer (instead of performing a buffer swap)")
+ ("overdraw,o", "overdraw previous image (instead of calling glClear)")
+ ("sleep,s", po::value<int>()->default_value(0), "Number of milliseconds to sleap in each frame (in the drawing phase)")
+ ;
+ po::variables_map vm;
+ po::store(po::parse_command_line(argc, argv, desc), vm);
+ po::notify(vm);
+
+ if (vm.count("help")) {
+ std::cout << desc << "\n";
+ return 1;
+ }
+
+ // actual program
+ TearTestWindow w(vm.count("overdraw"), vm.count("copy"), vm["sleep"].as<int>());