]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Video.hh
port to NetBSD
[chaz/yoink] / src / Moof / Video.hh
index d640ad2386ce7a4fefa4bdda725fb35485302297..193274f5fb5b7a82cee5611eb62d1e3bacc4c338 100644 (file)
@@ -35,8 +35,6 @@
 
 #include <SDL/SDL.h>
 
-#include <Moof/Exception.hh>
-
 
 namespace Mf {
 
@@ -45,8 +43,10 @@ class Video;
 typedef boost::shared_ptr<Video> VideoP;
 
 
-struct Video
+class Video
 {
+public:
+
        struct Attributes
        {
                // OpenGL attributes
@@ -75,21 +75,6 @@ struct Video
        };
 
 
-private:
-
-       void init(const Attributes& attribs);
-
-       void recreateContext();
-       void setOpenGLAttributes();
-
-       void setIcon();
-
-       SDL_Surface* context_;
-       unsigned flags_;
-       Attributes attribs_;
-
-public:
-
        static VideoP alloc(const std::string& caption, const std::string& icon)
        {
                return VideoP(new Video(caption, icon));
@@ -97,7 +82,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]);
@@ -128,17 +113,23 @@ public:
        void makeActive();
        void swap();
 
+       int getWidth() const;
+       int getHeight() const;
 
-       struct Exception : public Mf::Exception
-       {
-               explicit Exception(unsigned error) :
-                       Mf::Exception(error) {}
+private:
 
-               void raise()
-               {
-                       throw *this;
-               }
-       };
+       void init(const Attributes& attribs);
+
+       void recreateContext();
+       void setOpenGLAttributes();
+
+       void setIcon();
+
+       // TODO this implementation should be hidden
+
+       SDL_Surface*    mContext;
+       unsigned                mFlags;
+       Attributes              mAttribs;
 };
 
 
This page took 0.018789 seconds and 4 git commands to generate.