CGFLib - A library for Computer Graphics @ FEUP
 All Classes Files Functions Variables Pages
CGFapplication.h
Go to the documentation of this file.
1 #ifndef CG_CGFapplication
2 #define CG_CGFapplication
3 
9 #include "CGFscene.h"
10 #include "CGFinterface.h"
11 
12 #include <stdexcept>
13 #include <string>
14 
17 {
18  public:
20  ~CGFapplication();
21  void init(int*, char**);
22  void run();
23 
24  void setScene(CGFscene* gls);
25  void setInterface(CGFinterface* gli);
26 
27  int getMainWindow();
28 
29  static void snapshot();
30 
31  static float xy_aspect;
32  static int width;
33  static int height;
34  static int vpx, vpy, vpw, vph;
35 
36  static unsigned long getTime();
37 
38  void forceRefresh();
39 
40  static CGFapplication *activeApp;
41 
42  protected:
43  void activate();
44 
45  static int app_window;
46 
47  CGFscene* app_scene;
48 
49  CGFinterface* app_interface;
50 
51  static bool refreshRequested;
52 
53  void static gluiIdleFunction(void);
54  void static reshape(int, int);
55  void static display();
56  void environmentInit();
57  void updateScene();
58 };
59 
60 class GLexception: public std::runtime_error
62 {
63  public:
64  GLexception(const std::string& what_str): runtime_error(what_str) {}
65 
66 };
67 
68 #endif