#include <SDL/SDL.h>
+#include <Moof/Core.hh>
+
namespace Mf {
typedef boost::shared_ptr<Video> VideoP;
-struct Video
+class Video
{
+public:
+
struct Attributes
{
// OpenGL attributes
bool cursorGrab;
Attributes();
- };
+ private:
-private:
-
- void init(const Attributes& attribs);
-
- void recreateContext();
- void setOpenGLAttributes();
-
- void setIcon();
-
- SDL_Surface* context_;
- unsigned flags_;
- Attributes attribs_;
+ Backend backend;
+ };
-public:
static VideoP alloc(const std::string& caption, const std::string& icon)
{
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]);
void setCaption(const std::string& caption);
std::string getCaption() const;
+ const std::string& getIcon() const;
+
void setFull(bool full);
void toggleFull();
bool isFull() const;
void toggleCursorGrab();
bool isCursorGrab() const;
- void makeActive();
void swap();
+ int getWidth() const;
+ int getHeight() const;
- struct Exception : public std::runtime_error
- {
- explicit Exception(const std::string& what_arg) :
- std::runtime_error(what_arg) {}
- };
+private:
+
+ void init(const Attributes& attribs);
+
+ 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_