X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fvideo.hh;fp=src%2Fmoof%2Fvideo.hh;h=8b42cfddd8b9e181f0f94706f97c6aaf41c67c78;hp=ea331a02bfe2a0f76a068e9dc53df16a27e87bfd;hb=af88821a172c4dfd138b91b2a5148ae50b502fa2;hpb=d6990468d297a6cbee98e4d0d33ab37e1b2352c9 diff --git a/src/moof/video.hh b/src/moof/video.hh index ea331a0..8b42cfd 100644 --- a/src/moof/video.hh +++ b/src/moof/video.hh @@ -23,6 +23,8 @@ #include #include +#include +#include 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_; };