OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
stats.hpp
Go to the documentation of this file.
1 #ifndef OPENMW_COMPONENTS_RESOURCE_STATS_H
2 #define OPENMW_COMPONENTS_RESOURCE_STATS_H
3 
4 #include <osgViewer/ViewerEventHandlers>
5 
6 namespace osgViewer
7 {
8  class ViewerBase;
9 }
10 
11 namespace osg
12 {
13  class Switch;
14 }
15 
16 namespace Resource
17 {
18  class Profiler : public osgViewer::StatsHandler
19  {
20  public:
21  Profiler();
22  };
23 
24  class StatsHandler : public osgGA::GUIEventHandler
25  {
26  public:
27  StatsHandler();
28 
29  void setKey(int key) { _key = key; }
30  int getKey() const { return _key; }
31 
32  bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa);
33 
34  void setWindowSize(int w, int h);
35 
36  void toggle(osgViewer::ViewerBase* viewer);
37 
38  void setUpHUDCamera(osgViewer::ViewerBase* viewer);
39  void setUpScene(osgViewer::ViewerBase* viewer);
40 
42  virtual void getUsage(osg::ApplicationUsage& usage) const;
43 
44  private:
45  osg::ref_ptr<osg::Switch> _switch;
46  int _key;
47  osg::ref_ptr<osg::Camera> _camera;
49  bool _statsType;
50 
51  float _statsWidth;
52  float _statsHeight;
53 
54  std::string _font;
56 
58 
59  };
60 
61 }
62 
63 #endif
virtual void getUsage(osg::ApplicationUsage &usage) const
Definition: stats.cpp:319
bool _initialized
Definition: stats.hpp:48
float _characterSize
Definition: stats.hpp:55
Definition: stats.hpp:18
void setKey(int key)
Definition: stats.hpp:29
int _key
Definition: stats.hpp:46
void setUpHUDCamera(osgViewer::ViewerBase *viewer)
Definition: stats.cpp:119
float _statsWidth
Definition: stats.hpp:51
void setWindowSize(int w, int h)
Definition: stats.cpp:77
Profiler()
Definition: stats.cpp:37
osg::ref_ptr< osg::Camera > _camera
Definition: stats.hpp:47
float _statsHeight
Definition: stats.hpp:52
osg::ref_ptr< osg::Switch > _switch
Definition: stats.hpp:45
StatsHandler()
Definition: stats.cpp:18
void setUpScene(osgViewer::ViewerBase *viewer)
Definition: stats.cpp:244
int _resourceStatsChildNum
Definition: stats.hpp:57
bool _statsType
Definition: stats.hpp:49
int getKey() const
Definition: stats.hpp:30
void toggle(osgViewer::ViewerBase *viewer)
Definition: stats.cpp:93
std::string _font
Definition: stats.hpp:54
Definition: stats.hpp:24
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa)
Definition: stats.cpp:44