--- /dev/null
+
+/*] Copyright (c) 2009-2010, Charles McGarvey [**************************
+**] All rights reserved.
+*
+* vi:ts=4 sw=4 tw=75
+*
+* Distributable under the terms and conditions of the 2-clause BSD license;
+* see the file COPYING for a complete text of the license.
+*
+**************************************************************************/
+
+#ifndef _MOOF_APPLICATION_HH_
+#define _MOOF_APPLICATION_HH_
+
+/**
+ * \file application.hh
+ * The main loop.
+ */
+
+#include <boost/noncopyable.hpp>
+
+#include <moof/event.hh>
+#include <moof/math.hh>
+#include <moof/runloop.hh>
+#include <moof/timer.hh>
+
+
+namespace moof {
+
+
+class settings;
+
+class application : public runloop
+{
+public:
+
+ application(settings& settings);
+ virtual ~application() {}
+
+ virtual void update(scalar t, scalar dt) = 0;
+ virtual void draw(scalar alpha) const = 0;
+ virtual void handle_event(const event& event) = 0;
+
+
+private:
+
+ void dispatch_update(timer& timer, scalar t);
+ void dispatch_draw(timer& timer, scalar t);
+
+ scalar next_update_;
+ scalar total_time_;
+
+ timer update_timer_;
+ timer draw_timer_;
+
+
+ scalar timestep_;
+ scalar inverse_timestep_;
+};
+
+
+} // namespace moof
+
+#endif // _MOOF_APPLICATION_HH_
+