Scroom  0.14
measure-framerate.cc File Reference
#include <cstdlib>
#include <string>
#include <fmt/core.h>
#include <getopt.h>
#include <spdlog/spdlog.h>
#include <gtk/gtk.h>
#include <scroom/unused.hh>
#include "measure-framerate-callbacks.hh"
#include "measure-framerate-tests.hh"
Include dependency graph for measure-framerate.cc:

Functions

void usage (const std::string &me, const std::string &message=std::string())
 
int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)
36 {
37  const std::string me = argv[0];
38  char result;
39 
40  while((result = getopt(argc, argv, ":h")) != -1)
41  {
42  switch(result)
43  {
44  case 'h':
45  usage(me);
46  break;
47  case '?':
48  // show usage -- unknown option
49  usage(me, "Unknown option");
50  break;
51  case ':':
52  // show usage -- missing argument
53  usage(me, "Option requires an argument");
54  break;
55  default:
56  usage(me, "This shouldn't be happening");
57  break;
58  }
59  }
60 
61  // while(optind < argc)
62  // {
63  // filenames.push_back(std::string(argv[optind]));
64  // optind++;
65  // }
66 
67  setlocale(LC_ALL, ""); // NOLINT(concurrency-mt-unsafe)
68  gtk_init(&argc, &argv);
69 
70  GtkWidget* window = create_window();
71  UNUSED(window);
72 
73  init_tests();
74  init();
75 
76  gtk_main();
77  return 0;
78 }
Here is the call graph for this function:

◆ usage()

void usage ( const std::string &  me,
const std::string &  message = std::string() 
)
23 {
24  if(message.length() != 0)
25  {
26  spdlog::error("{}", message);
27  }
28 
29  fmt::print("Usage: {} [options] [input files]\n\n", me);
30  fmt::print("Options:\n");
31  fmt::print(" -h : Show this help\n");
32  exit(-1); // NOLINT(concurrency-mt-unsafe)
33 }

Referenced by main().

Here is the caller graph for this function:
UNUSED
#define UNUSED(x)
Definition: unused.hh:10
create_window
GtkWidget * create_window()
Definition: measure-framerate-callbacks.cc:79
init_tests
void init_tests()
Definition: measure-framerate-tests.cc:152
usage
void usage(const std::string &me, const std::string &message=std::string())
Definition: measure-framerate.cc:22
init
void init()
Definition: measure-framerate-callbacks.cc:98