EventPump.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00031 #ifndef _GG_EventPump_h_
00032 #define _GG_EventPump_h_
00033
00034 #include <GG/GUI.h>
00035
00036
00037 namespace GG {
00038
00043 struct GG_API EventPumpState
00044 {
00045 EventPumpState();
00046
00047 unsigned int last_FPS_time;
00048 unsigned int last_frame_time;
00049 unsigned int most_recent_time;
00050 std::size_t frames;
00051 };
00052
00058 class GG_API EventPumpBase
00059 {
00060 protected:
00071 void LoopBody(GUI* gui, EventPumpState& state, bool do_non_rendering, bool do_rendering);
00072
00074 static EventPumpState& State();
00075 };
00076
00120 class GG_API EventPump : public EventPumpBase
00121 {
00122 public:
00123 virtual ~EventPump() {}
00124
00127 virtual void operator()();
00128 };
00129
00134 class GG_API ModalEventPump : public EventPump
00135 {
00136 public:
00137 ModalEventPump(const bool& done);
00138 virtual void operator()();
00139
00140 protected:
00142 bool Done() const;
00143
00144 private:
00145 const bool& m_done;
00146 };
00147
00148 }
00149
00150 #endif // _GG_EventPump_h_