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
00030 #ifndef _GG_EventPump_h_
00031 #define _GG_EventPump_h_
00032
00033 #include <GG/GUI.h>
00034
00035
00036 namespace GG {
00037
00040 struct GG_API EventPumpState
00041 {
00042 EventPumpState();
00043
00044 int last_FPS_time;
00045 int last_frame_time;
00046 int most_recent_time;
00047 int frames;
00048 };
00049
00053 class GG_API EventPumpBase
00054 {
00055 protected:
00062 void LoopBody(GUI* gui, EventPumpState& state, bool do_non_rendering, bool do_rendering);
00063
00065 static EventPumpState& State();
00066 };
00067
00074 class GG_API EventPump : public EventPumpBase
00075 {
00076 public:
00077 virtual ~EventPump() {}
00078
00080 virtual void operator()();
00081 };
00082
00086 class GG_API ModalEventPump : public EventPump
00087 {
00088 public:
00089 ModalEventPump(const bool& done);
00090 virtual void operator()();
00091
00092 protected:
00093 bool Done() const;
00094
00095 private:
00096 const bool& m_done;
00097 };
00098
00099 }
00100
00101 #endif // _GG_EventPump_h_