X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2FMoof%2FVideo.hh;fp=src%2Fvideo.hh;h=a76dca268ef052f136124bc425769d6f65a32f72;hp=ad896506161635f8ac60ec8a6dfe387773256d0c;hb=c2321281bf12a7efaedde930422c7ddbc92080d4;hpb=87bc17e55b0c1dc73ecc66df856d3f08fd7a7724 diff --git a/src/video.hh b/src/Moof/Video.hh similarity index 82% rename from src/video.hh rename to src/Moof/Video.hh index ad89650..a76dca2 100644 --- a/src/video.hh +++ b/src/Moof/Video.hh @@ -26,8 +26,8 @@ *******************************************************************************/ -#ifndef _VIDEO_HH_ -#define _VIDEO_HH_ +#ifndef _MOOF_VIDEO_HH_ +#define _MOOF_VIDEO_HH_ #include @@ -36,13 +36,13 @@ #include -namespace dc { +namespace Mf { -class video +class Video { public: - struct attributes + struct Attributes { // OpenGL attributes long colorBuffer[4]; // rgba @@ -64,17 +64,17 @@ public: 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(); @@ -101,22 +101,29 @@ public: 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