*******************************************************************************/
-#ifndef _VIDEO_HH_
-#define _VIDEO_HH_
+#ifndef _MOOF_VIDEO_HH_
+#define _MOOF_VIDEO_HH_
#include <string>
#include <SDL/SDL.h>
-namespace dc {
+namespace Mf {
-class video
+class Video
{
public:
- struct attributes
+ struct Attributes
{
// OpenGL attributes
long colorBuffer[4]; // rgba
bool cursorVisible;
bool cursorGrab;
- attributes();
+ Attributes();
};
- video();
- video(const attributes& attribs);
- video(const attributes& attribs, const std::string& caption);
- video(const std::string& caption);
- ~video();
+ Video();
+ Video(const Attributes& attribs);
+ Video(const Attributes& attribs, const std::string& caption);
+ Video(const std::string& caption);
+ ~Video();
void setVideoMode(const long mode[3]);
- attributes getAttributes() const;
+ Attributes getAttributes() const;
void resize(int width, int height);
bool iconify();
void makeActive();
void swap();
+
+ struct Exception : public std::runtime_error
+ {
+ explicit Exception(const std::string& what_arg) :
+ std::runtime_error(what_arg) {}
+ };
+
private:
- void init(const attributes& attribs, const std::string& caption);
+ void init(const Attributes& attribs, const std::string& caption);
void recreateContext();
void setOpenGLAttributes();
SDL_Surface* context_;
unsigned flags_;
- attributes attribs_;
+ Attributes attribs_;
};
-typedef boost::shared_ptr<video> video_ptr;
+typedef boost::shared_ptr<Video> VideoPtr;
-} // namespace dc
+} // namespace Mf
-#endif // _VIDEO_HH_
+#endif // _MOOF_VIDEO_HH_
/** vim: set ts=4 sw=4 tw=80: *************************************************/