]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Video.hh
refactoring needed for win32 crash
[chaz/yoink] / src / Moof / Video.hh
index 5f56f9e1d33e103ac0bf912b7f6584d0e45b516d..0199bc51dc43e3a38508fae9da2d81149b4a7ac0 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <SDL/SDL.h>
 
-#include <Moof/Exception.hh>
+#include <Moof/Core.hh>
 
 
 namespace Mf {
@@ -45,8 +45,10 @@ class Video;
 typedef boost::shared_ptr<Video> VideoP;
 
 
-struct Video
+class Video
 {
+public:
+
        struct Attributes
        {
                // OpenGL attributes
@@ -72,23 +74,12 @@ struct Video
                bool            cursorGrab;
 
                Attributes();
-       };
-
-
-private:
-
-       void init(const Attributes& attribs);
 
-       void recreateContext();
-       void setOpenGLAttributes();
+       private:
 
-       void setIcon();
-
-       SDL_Surface* context_;
-       unsigned flags_;
-       Attributes attribs_;
+               Backend         backend;
+       };
 
-public:
 
        static VideoP alloc(const std::string& caption, const std::string& icon)
        {
@@ -97,7 +88,7 @@ public:
 
        Video();
        explicit Video(const Attributes& attribs);
-       explicit Video(const std::string& caption, const std::string& icon);
+       Video(const std::string& caption, const std::string& icon);
        ~Video();
 
        void setVideoMode(const long mode[3]);
@@ -109,6 +100,8 @@ public:
        void setCaption(const std::string& caption);
        std::string getCaption() const;
 
+       const std::string& getIcon() const;
+
        void setFull(bool full);
        void toggleFull();
        bool isFull() const;
@@ -125,26 +118,31 @@ public:
        void toggleCursorGrab();
        bool isCursorGrab() const;
 
-       void makeActive();
        void swap();
 
        int getWidth() const;
        int getHeight() const;
 
+private:
 
-       struct Exception : public Mf::Exception
-       {
-               explicit Exception(unsigned error) :
-                       Mf::Exception(error) {}
+       void init(const Attributes& attribs);
 
-               void raise()
-               {
-                       throw *this;
-               }
-       };
+       void recreateContext();
+       void setOpenGLAttributes();
+
+       void setIcon();
+
+       // TODO this implementation should be hidden
+
+       SDL_Surface*    mContext;
+       unsigned                mFlags;
+       Attributes              mAttribs;
 };
 
 
+extern Video* video;
+
+
 } // namespace Mf
 
 #endif // _MOOF_VIDEO_HH_
This page took 0.02219 seconds and 4 git commands to generate.