Thrive
CEGUIVideoPlayer.h
1 #pragma once
2 
3 #include <CEGUI/CEGUI.h>
4 #include <luabind/object.hpp>
5 #include <OgreVector2.h>
6 #include <OISKeyboard.h>
7 
8 #include "gui/CEGUIWindow.h"
9 
10 namespace luabind {
11 class scope;
12 }
13 
14 namespace Video {
15 class VideoPlayer;
16 }
17 
18 namespace Ogre {
19  class BitmapImage;
20  class Pass;
21 }
22 
23 namespace thrive {
24 
25 //Note, currently doesn't support multiple video players (crashes) but since this isn't needed atm it's left unfixed
26 
28 
29 public:
30 
40  std::string name,
41  int width,
42  int height
43  );
44 
54  std::string name
55  );
56 
57 
61  virtual
63 
64 
81  static luabind::scope
82  luaBindings();
83 
91  void
92  setVideo(
93  std::string videoName
94  );
95 
96  void
97  play();
98 
99  void
100  pause();
101 
102  void
103  update();
104 
105  bool
106  isPaused();
107 
108  double
109  getDuration();
110 
111  double
112  getCurrentTime();
113 
114  void
115  seek(
116  double time
117  );
118 
119  //Necessary to avoid ogre error when exiting game
120  static void
121  destroyVideoPlayer(CEGUIVideoPlayer* player);
122 
123 private:
124 
125  std::unique_ptr<Video::VideoPlayer> m_videoPlayer;
126  Ogre::Pass * m_videoMaterialPass = nullptr;
127  CEGUI::BitmapImage* m_videoImage = nullptr;
128  Ogre::TextureUnitState* m_tex = nullptr;
129 };
130 
131 }
void setVideo(std::string videoName)
Sets the video to play.
Definition: CEGUIVideoPlayer.cpp:115
virtual ~CEGUIVideoPlayer()
Destructor.
Definition: CEGUIVideoPlayer.cpp:53
Definition: CEGUIVideoPlayer.h:27
CEGUIVideoPlayer(std::string name, int width, int height)
Constructor.
Definition: CEGUIVideoPlayer.cpp:28
Definition: CEGUIWindow.h:17
static luabind::scope luaBindings()
Lua bindings.
Definition: CEGUIVideoPlayer.cpp:59
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
Definition: debug_drawing.h:8
Definition: CEGUIVideoPlayer.h:14