]> Dogcows Code - chaz/yoink/blobdiff - src/moof/video.hh
further implementing runloop support
[chaz/yoink] / src / moof / video.hh
index ea331a02bfe2a0f76a068e9dc53df16a27e87bfd..8b42cfddd8b9e181f0f94706f97c6aaf41c67c78 100644 (file)
@@ -23,6 +23,8 @@
 #include <SDL/SDL.h>
 
 #include <moof/backend.hh>
+#include <moof/math.hh>
+#include <moof/timer.hh>
 
 
 namespace moof {
@@ -87,7 +89,7 @@ public:
        bool iconify();
 
        void caption(const std::string& caption);
-       std::string caption() const;
+       const std::string& caption() const;
 
        void fullscreen(bool full);
        bool fullscreen() const;
@@ -109,7 +111,7 @@ public:
        /**
         * Swap the video buffers if double-buffered.
         */
-       void swap();
+       void swap(scalar t = timer::ticks());
 
 
        /**
@@ -140,6 +142,20 @@ public:
        int height() const;
 
 
+       void show_fps(bool show)
+       {
+               show_fps_ = show;
+               fps_accumulator_ = SCALAR(0.0);
+               fps_counter_ = 0;
+               last_swap_ = SCALAR(0.0);
+       }
+
+       bool show_fps() const
+       {
+               return show_fps_;
+       }
+
+
 private:
 
        void init();
@@ -152,6 +168,11 @@ private:
        SDL_Surface*            context_;
        int                                     flags_;
        class attributes        attributes_;
+       bool                            show_fps_;
+       std::string                     caption_;
+       scalar                          fps_accumulator_;
+       int                                     fps_counter_;
+       scalar                          last_swap_;
 
        static video*           current_;
 };
This page took 0.019347 seconds and 4 git commands to generate.