OpenMW
apps/openmw/mwrender/videoplayer.hpp
Go to the documentation of this file.
00001 #ifndef VIDEOPLAYER_H
00002 #define VIDEOPLAYER_H
00003 
00004 #include <OgreMaterial.h>
00005 
00006 namespace Ogre
00007 {
00008     class SceneManager;
00009     class SceneNode;
00010     class Rectangle2D;
00011     class RenderWindow;
00012 }
00013 
00014 namespace MWRender
00015 {
00016     struct VideoState;
00017 
00018     class VideoPlayer
00019     {
00020     public:
00021         VideoPlayer(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* window);
00022         ~VideoPlayer();
00023 
00024         void playVideo (const std::string& resourceName, bool allowSkipping);
00025 
00026         void update();
00027 
00028         void close();
00029         void stopVideo();
00030 
00031         bool isPlaying();
00032 
00033         void setResolution (int w, int h) { mWidth = w; mHeight = h; }
00034 
00035 
00036     private:
00037         VideoState* mState;
00038 
00039         bool mAllowSkipping;
00040 
00041         Ogre::SceneManager* mSceneMgr;
00042         Ogre::MaterialPtr mVideoMaterial;
00043         Ogre::Rectangle2D* mRectangle;
00044         Ogre::Rectangle2D* mBackgroundRectangle;
00045         Ogre::SceneNode* mNode;
00046         Ogre::SceneNode* mBackgroundNode;
00047         Ogre::RenderWindow* mWindow;
00048 
00049         int mWidth;
00050         int mHeight;
00051     };
00052 }
00053 
00054 #endif