#include <SDL/SDL.h>
#include <moof/backend.hh>
+#include <moof/math.hh>
+#include <moof/timer.hh>
namespace moof {
explicit video(const std::string& caption = "Moof!!");
explicit video(const class attributes& attribs);
- explicit video(const std::string& caption,
+ video(const std::string& caption,
const class attributes& attribs);
~video();
bool iconify();
void caption(const std::string& caption);
- std::string caption() const;
+ const std::string& caption() const;
void fullscreen(bool full);
bool fullscreen() const;
/**
* Swap the video buffers if double-buffered.
*/
- void swap();
+ void swap(scalar t = timer::ticks());
/**
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();
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_;
};