00001 #ifndef GLUTM_MASTER_H
00002 #define GLUTM_MASTER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00033 #include <glutm/config.h>
00034
00036
00064 class GlutWindow;
00065 class GlutMenu;
00066
00067 class GlutMaster
00068 {
00069 friend class GlutWindow;
00070 friend class GlutMenu;
00071
00072 public:
00073
00080 static void init();
00081
00088 static void init(int argc,char *argv[]);
00089
00095 static void mainLoop();
00096
00097
00098
00099
00100
00102 static int getScreenWidth();
00104 static int getScreenHeight();
00105
00107 static int getScreenWidthMm();
00109 static int getScreenHeightMm();
00110
00112 static int getElapsedTime();
00113
00114 private:
00115
00116
00117
00118
00119
00121 GlutMaster();
00123 GlutMaster(const GlutMaster &);
00125 ~GlutMaster();
00126
00128 static GlutMaster _glutMaster;
00129
00131 static GlutWindow *currentWindow();
00132
00134 static void openWindow(GlutWindow *glutWindow);
00136 static void closeWindow(GlutWindow *glutWindow);
00137
00139
00140 static void positionWindow(GlutWindow *window,int x,int y);
00141 static void reshapeWindow (GlutWindow *window,int width,int height);
00142 static void setCursor (GlutWindow *window,int cursor);
00143 static void setTimer (GlutWindow *window,unsigned int msec,unsigned int val);
00144 static void setTick (GlutWindow *window,unsigned int msec);
00145 static void setIdle (GlutWindow *window,bool idle);
00146 static void postRedisplay (GlutWindow *window);
00147 static void swapBuffers (GlutWindow *window);
00148 static void fullScreen (GlutWindow *window);
00149 static void gameMode (GlutWindow *window);
00150
00151 static int get (const GlutWindow *window,int info);
00152
00153
00154
00155 static int _idleCount;
00156
00158 static bool _glutInit;
00159
00161 static void updateModifiers(GlutWindow *window);
00162
00163
00164
00165
00166
00167
00168 static void OnDisplay();
00169 static void OnIdle();
00170 static void OnTimer(int val);
00171 static void OnKeyboard(unsigned char key, int x, int y);
00172 static void OnKeyboardUp(unsigned char key, int x, int y);
00173 static void OnSpecial(int key, int x, int y);
00174 static void OnSpecialUp(int key, int x, int y);
00175 static void OnMenu(int value);
00176 static void OnMotion(int x, int y);
00177 static void OnMouse(int button, int state, int x, int y);
00178 static void OnPassiveMotion(int x, int y);
00179 static void OnEntry(int state);
00180 static void OnReshape(int w, int h);
00181 static void OnVisibility(int visible);
00182
00183
00184
00185 static void CheckShutdown(int val);
00186 static void CheckOnOpen (int val);
00187 static void CheckOnClose (int val);
00188 };
00189
00190 #endif
00191
00192
00193