]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Video.hh
considerable refactoring
[chaz/yoink] / src / Moof / Video.hh
index bb1fdd48db9b168a086be687c6cc2f51fe55a284..4be691dcf62ec0af20c06abf9bab6cdd58ff4ee0 100644 (file)
 namespace Mf {
 
 
-class Video
+class Video;
+typedef boost::shared_ptr<Video> VideoP;
+
+
+struct Video
 {
-public:
        struct Attributes
        {
                // OpenGL attributes
@@ -69,6 +72,28 @@ public:
                Attributes();
        };
 
+
+private:
+
+       void init(const Attributes& attribs);
+
+       void recreateContext();
+       void setOpenGLAttributes();
+
+       void setIcon();
+
+       SDL_Surface* context_;
+       unsigned flags_;
+       Attributes attribs_;
+
+public:
+
+       inline static VideoP alloc(const std::string& caption,
+                       const std::string& icon)
+       {
+               return VideoP(new Video(caption, icon));
+       }
+
        Video();
        explicit Video(const Attributes& attribs);
        explicit Video(const std::string& caption, const std::string& icon);
@@ -108,22 +133,8 @@ public:
                explicit Exception(const std::string& what_arg) :
                        std::runtime_error(what_arg) {}
        };
-
-private:
-       void init(const Attributes& attribs);
-
-       void recreateContext();
-       void setOpenGLAttributes();
-
-       void setIcon();
-
-       SDL_Surface* context_;
-       unsigned flags_;
-       Attributes attribs_;
 };
 
-typedef boost::shared_ptr<Video> VideoPtr;
-
 
 } // namespace Mf
 
This page took 0.0213 seconds and 4 git commands to generate.