Euphoria
app.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <functional>
5 #include <memory>
6 
7 // for sdl main to work
8 #include "SDL.h"
9 
10 #include "base/rgb.h"
11 
12 
13 namespace eu::window
14 {
15  struct App
16  {
17  bool running = true;
19 
20  App();
21  virtual ~App() = default;
22 
23  App(const App&) = delete;
24  App(App&&) = delete;
25  void operator=(const App&) = delete;
26  void operator=(App&&) = delete;
27 
28  virtual void on_quit();
29  virtual void on_gui();
30  };
31 
32 
33  using CreateAppFunction = std::function
34  <
35  std::unique_ptr<App>
36  ()
37  >;
38 
39 
40  int run_app(int argc, char** argv, const std::string& title, CreateAppFunction create);
41 }
std::function< std::unique_ptr< App >() > CreateAppFunction
Definition: app.h:37
int run_app(int argc, char **argv, const std::string &window_title, CreateAppFunction create_app)
Definition: app.cc:40
Definition: rgb.h:62
App(const App &)=delete
void operator=(const App &)=delete
App(App &&)=delete
virtual void on_quit()
Definition: app.cc:27
bool running
Definition: app.h:17
void operator=(App &&)=delete
virtual ~App()=default
virtual void on_gui()
Definition: app.cc:33
Rgb clear_color
Definition: app.h:18