]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Video.hh
extreme refactoring
[chaz/yoink] / src / Moof / Video.hh
similarity index 82%
rename from src/video.hh
rename to src/Moof/Video.hh
index ad896506161635f8ac60ec8a6dfe387773256d0c..a76dca268ef052f136124bc425769d6f65a32f72 100644 (file)
@@ -26,8 +26,8 @@
 
 *******************************************************************************/
 
-#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
@@ -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<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: *************************************************/
 
This page took 0.022961 seconds and 4 git commands to generate.