OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
loadingscreen.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_LOADINGSCREEN_H
2 #define MWGUI_LOADINGSCREEN_H
3 
4 #include <osg/Timer>
5 #include <osg/ref_ptr>
6 
7 #include "windowbase.hpp"
8 
10 
11 namespace osgViewer
12 {
13  class Viewer;
14 }
15 
16 namespace osg
17 {
18  class Texture2D;
19 }
20 
21 namespace VFS
22 {
23  class Manager;
24 }
25 
26 namespace MWGui
27 {
28  class BackgroundImage;
29 
31  {
32  public:
33  LoadingScreen(const VFS::Manager* vfs, osgViewer::Viewer* viewer);
34  virtual ~LoadingScreen();
35 
37  virtual void setLabel (const std::string& label, bool important);
38  virtual void loadingOn();
39  virtual void loadingOff();
40  virtual void setProgressRange (size_t range);
41  virtual void setProgress (size_t value);
42  virtual void increaseProgress (size_t increase=1);
43 
44  virtual void setVisible(bool visible);
45 
46  private:
47  void findSplashScreens();
49 
51  osg::ref_ptr<osgViewer::Viewer> mViewer;
52 
54 
57  osg::Timer mTimer;
59 
61 
62  size_t mProgress;
63 
64  MyGUI::Widget* mLoadingBox;
65 
66  MyGUI::TextBox* mLoadingText;
67  MyGUI::ScrollBar* mProgressBar;
69 
70  std::vector<std::string> mSplashScreens;
71 
72  // TODO: add releaseGLObjects() for mTexture
73 
74  osg::ref_ptr<osg::Texture2D> mTexture;
75  std::auto_ptr<MyGUI::ITexture> mGuiTexture;
76 
77  void changeWallpaper();
78 
79  void draw();
80  };
81 
82 }
83 
84 
85 #endif
double mTargetFrameRate
Definition: loadingscreen.hpp:53
virtual void setLabel(const std::string &label, bool important)
Overridden from Loading::Listener, see the Loading::Listener documentation for usage details...
Definition: loadingscreen.cpp:86
virtual void loadingOn()
Definition: loadingscreen.cpp:126
void findSplashScreens()
Definition: loadingscreen.cpp:62
MyGUI::Widget * mLoadingBox
Definition: loadingscreen.hpp:64
osg::ref_ptr< osgViewer::Viewer > mViewer
Definition: loadingscreen.hpp:51
virtual void setProgressRange(size_t range)
Set the total range of progress (e.g. the number of objects to load).
Definition: loadingscreen.cpp:215
osg::Timer mTimer
Definition: loadingscreen.hpp:57
virtual void setProgress(size_t value)
Set current progress. Valid range is [0, progressRange)
Definition: loadingscreen.cpp:223
std::auto_ptr< MyGUI::ITexture > mGuiTexture
Definition: loadingscreen.hpp:75
Definition: loadinglistener.hpp:8
const VFS::Manager * mVFS
Definition: loadingscreen.hpp:50
bool mImportantLabel
Definition: loadingscreen.hpp:60
Definition: loadingscreen.hpp:30
void changeWallpaper()
Definition: loadingscreen.cpp:202
MyGUI::TextBox * mLoadingText
Definition: loadingscreen.hpp:66
std::vector< std::string > mSplashScreens
Definition: loadingscreen.hpp:70
virtual ~LoadingScreen()
Definition: loadingscreen.cpp:58
double mLastWallpaperChangeTime
Definition: loadingscreen.hpp:55
MyGUI::ScrollBar * mProgressBar
Definition: loadingscreen.hpp:67
virtual void loadingOff()
Definition: loadingscreen.cpp:180
size_t mProgress
Definition: loadingscreen.hpp:62
Definition: windowbase.hpp:16
virtual void increaseProgress(size_t increase=1)
Increase current progress, default by 1.
Definition: loadingscreen.cpp:235
BackgroundImage * mBackgroundImage
Definition: loadingscreen.hpp:68
The main class responsible for loading files from a virtual file system.
Definition: manager.hpp:20
double mLoadingOnTime
Definition: loadingscreen.hpp:58
void draw()
Definition: loadingscreen.cpp:270
bool needToDrawLoadingScreen()
Definition: loadingscreen.cpp:245
A variant of MyGUI::ImageBox with aspect ratio correction using black bars.
Definition: backgroundimage.hpp:12
osg::ref_ptr< osg::Texture2D > mTexture
Definition: loadingscreen.hpp:74
LoadingScreen(const VFS::Manager *vfs, osgViewer::Viewer *viewer)
Definition: loadingscreen.cpp:31
double mLastRenderTime
Definition: loadingscreen.hpp:56
virtual void setVisible(bool visible)
Sets the visibility of the window.
Definition: loadingscreen.cpp:98