]> git.tdb.fi Git - libs/gui.git/blobdiff - source/display.h
Implement the rest of fullscreen mode (video mode switching, pointer grab)
[libs/gui.git] / source / display.h
index 0433eab22404163996491fa5ca772732f750b09a..7397a785c309513e6459833cd4779162ea494a65 100644 (file)
@@ -23,6 +23,9 @@ struct VideoMode
        unsigned width;
        unsigned height;
        unsigned rate;
+
+       VideoMode(): width(0), height(0), rate(0) { }
+       VideoMode(unsigned w, unsigned h): width(w), height(h), rate(0) { }
 };
 
 class Display
@@ -30,6 +33,7 @@ class Display
 private:
        ::Display *display;
        std::list<VideoMode> modes;
+       VideoMode orig_mode;
        std::map<WindowHandle, Window *> windows;
 
 public:
@@ -43,6 +47,7 @@ public:
 
        const std::list<VideoMode> &get_modes() const { return modes; }
        void set_mode(const VideoMode &);
+       void restore_mode() { set_mode(orig_mode); }
 
        void tick();
        void check_error();