Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

glutm/master.h

Go to the documentation of this file.
00001 #ifndef GLUTM_MASTER_H
00002 #define GLUTM_MASTER_H
00003 
00004 /*
00005 
00006   GLT OpenGL C++ Toolkit (LGPL)
00007   Copyright (C) 2000-2002 Nigel Stewart  
00008 
00009   Email: nigels.com@gmail.com   
00010   WWW:   http://www.nigels.com/glt/
00011 
00012   This library is free software; you can redistribute it and/or
00013   modify it under the terms of the GNU Lesser General Public
00014   License as published by the Free Software Foundation; either
00015   version 2.1 of the License, or (at your option) any later version.
00016 
00017   This library is distributed in the hope that it will be useful,
00018   but WITHOUT ANY WARRANTY; without even the implied warranty of
00019   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020   Lesser General Public License for more details.
00021 
00022   You should have received a copy of the GNU Lesser General Public
00023   License along with this library; if not, write to the Free Software
00024   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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     // glutGet() 
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     // GlutMaster internals are hidden from user.
00117     // The GLUT library is initialised by default,
00118     // but can be initialised via init(), if necessary
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     // All GLUT events are routed through these handlers.
00165     // They will be passed along to the appropriate window(s) automatically.
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 

Generated on Tue Nov 5 11:11:04 2002 for GLT by doxygen1.2.18