00001 #ifndef __glutint_h__
00002 #define __glutint_h__
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #if defined(__CYGWIN32__)
00011 #include <sys/time.h>
00012 #endif
00013 
00014 #if defined(_WIN32)
00015 #include "glutwin32.h"
00016 #else
00017 #ifdef __sgi
00018 #define SUPPORT_FORTRAN
00019 #endif
00020 #include <X11/Xlib.h>
00021 #include <X11/Xutil.h>
00022 #include <GL/glx.h>
00023 #endif
00024 
00025 #include "glutwacom.h"
00026 
00027 
00028 
00029 
00030 #ifndef APIENTRY
00031 #define APIENTRY
00032 #endif
00033 
00034 #ifdef __vms
00035 #if ( __VMS_VER < 70000000 )
00036 struct timeval {
00037   __int64 val;
00038 };
00039 extern int sys$gettim(struct timeval *);
00040 #else
00041 #include <time.h>
00042 #endif
00043 #else
00044 #include <sys/types.h>
00045 #if !defined(_WIN32)
00046 #include <sys/time.h>
00047 #else
00048 #include <winsock.h>
00049 #endif
00050 #endif
00051 #if defined(__vms) && ( __VMS_VER < 70000000 )
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 #define TICKS_PER_MILLISECOND 10000
00060 #define TICKS_PER_SECOND      10000000
00061 
00062 #define GETTIMEOFDAY(_x) (void) sys$gettim (_x);
00063 
00064 #define ADD_TIME(dest, src1, src2) { \
00065   (dest).val = (src1).val + (src2).val; \
00066 }
00067 
00068 #define TIMEDELTA(dest, src1, src2) { \
00069   (dest).val = (src1).val - (src2).val; \
00070 }
00071 
00072 #define IS_AFTER(t1, t2) ((t2).val > (t1).val)
00073 
00074 #define IS_AT_OR_AFTER(t1, t2) ((t2).val >= (t1).val)
00075 
00076 #else
00077 #if defined(SVR4) && !defined(sun)  
00078 
00079 #define GETTIMEOFDAY(_x) gettimeofday(_x)
00080 #else
00081 #define GETTIMEOFDAY(_x) gettimeofday(_x, NULL)
00082 #endif
00083 #define ADD_TIME(dest, src1, src2) { \
00084   if(((dest).tv_usec = \
00085     (src1).tv_usec + (src2).tv_usec) >= 1000000) { \
00086     (dest).tv_usec -= 1000000; \
00087     (dest).tv_sec = (src1).tv_sec + (src2).tv_sec + 1; \
00088   } else { \
00089     (dest).tv_sec = (src1).tv_sec + (src2).tv_sec; \
00090     if(((dest).tv_sec >= 1) && (((dest).tv_usec <0))) { \
00091       (dest).tv_sec --;(dest).tv_usec += 1000000; \
00092     } \
00093   } \
00094 }
00095 #define TIMEDELTA(dest, src1, src2) { \
00096   if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \
00097     (dest).tv_usec += 1000000; \
00098     (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \
00099   } else { \
00100      (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \
00101   } \
00102 }
00103 #define IS_AFTER(t1, t2) \
00104   (((t2).tv_sec > (t1).tv_sec) || \
00105   (((t2).tv_sec == (t1).tv_sec) && \
00106   ((t2).tv_usec > (t1).tv_usec)))
00107 #define IS_AT_OR_AFTER(t1, t2) \
00108   (((t2).tv_sec > (t1).tv_sec) || \
00109   (((t2).tv_sec == (t1).tv_sec) && \
00110   ((t2).tv_usec >= (t1).tv_usec)))
00111 #endif
00112 
00113 #define IGNORE_IN_GAME_MODE() \
00114   { if (__glutGameModeWindow) return; }
00115 
00116 #define GLUT_WIND_IS_RGB(x)         (((x) & GLUT_INDEX) == 0)
00117 #define GLUT_WIND_IS_INDEX(x)       (((x) & GLUT_INDEX) != 0)
00118 #define GLUT_WIND_IS_SINGLE(x)      (((x) & GLUT_DOUBLE) == 0)
00119 #define GLUT_WIND_IS_DOUBLE(x)      (((x) & GLUT_DOUBLE) != 0)
00120 #define GLUT_WIND_HAS_ACCUM(x)      (((x) & GLUT_ACCUM) != 0)
00121 #define GLUT_WIND_HAS_ALPHA(x)      (((x) & GLUT_ALPHA) != 0)
00122 #define GLUT_WIND_HAS_DEPTH(x)      (((x) & GLUT_DEPTH) != 0)
00123 #define GLUT_WIND_HAS_STENCIL(x)    (((x) & GLUT_STENCIL) != 0)
00124 #define GLUT_WIND_IS_MULTISAMPLE(x) (((x) & GLUT_MULTISAMPLE) != 0)
00125 #define GLUT_WIND_IS_STEREO(x)      (((x) & GLUT_STEREO) != 0)
00126 #define GLUT_WIND_IS_LUMINANCE(x)   (((x) & GLUT_LUMINANCE) != 0)
00127 #define GLUT_MAP_WORK               (1 << 0)
00128 #define GLUT_EVENT_MASK_WORK        (1 << 1)
00129 #define GLUT_REDISPLAY_WORK         (1 << 2)
00130 #define GLUT_CONFIGURE_WORK         (1 << 3)
00131 #define GLUT_COLORMAP_WORK          (1 << 4)
00132 #define GLUT_DEVICE_MASK_WORK     (1 << 5)
00133 #define GLUT_FINISH_WORK       (1 << 6)
00134 #define GLUT_DEBUG_WORK        (1 << 7)
00135 #define GLUT_DUMMY_WORK        (1 << 8)
00136 #define GLUT_FULL_SCREEN_WORK       (1 << 9)
00137 #define GLUT_OVERLAY_REDISPLAY_WORK (1 << 10)
00138 #define GLUT_REPAIR_WORK            (1 << 11)
00139 #define GLUT_OVERLAY_REPAIR_WORK    (1 << 12)
00140 
00141 
00142 #define RGBA                    0
00143 #define BUFFER_SIZE             1
00144 #define DOUBLEBUFFER            2
00145 #define STEREO                  3
00146 #define AUX_BUFFERS             4
00147 #define RED_SIZE                5  
00148 
00149 #define GREEN_SIZE              6
00150 #define BLUE_SIZE               7
00151 #define ALPHA_SIZE              8
00152 #define DEPTH_SIZE              9
00153 #define STENCIL_SIZE            10
00154 #define ACCUM_RED_SIZE          11  
00155 
00156 #define ACCUM_GREEN_SIZE        12
00157 #define ACCUM_BLUE_SIZE         13
00158 #define ACCUM_ALPHA_SIZE        14
00159 #define LEVEL                   15
00160 
00161 #define NUM_GLXCAPS             (LEVEL + 1)
00162 
00163 #define XVISUAL                 (NUM_GLXCAPS + 0)
00164 #define TRANSPARENT             (NUM_GLXCAPS + 1)
00165 #define SAMPLES                 (NUM_GLXCAPS + 2)
00166 #define XSTATICGRAY             (NUM_GLXCAPS + 3)  
00167 
00168 
00169 
00170 
00171 #define XGRAYSCALE              (NUM_GLXCAPS + 4)
00172 #define XSTATICCOLOR            (NUM_GLXCAPS + 5)
00173 #define XPSEUDOCOLOR            (NUM_GLXCAPS + 6)
00174 #define XTRUECOLOR              (NUM_GLXCAPS + 7)
00175 #define XDIRECTCOLOR            (NUM_GLXCAPS + 8)
00176 #define SLOW                    (NUM_GLXCAPS + 9)
00177 #define CONFORMANT              (NUM_GLXCAPS + 10)
00178 
00179 #define NUM_CAPS                (NUM_GLXCAPS + 11)
00180 
00181 
00182 
00183 #define NUM                     (NUM_CAPS + 0)
00184 #define RGBA_MODE               (NUM_CAPS + 1)
00185 #define CI_MODE                 (NUM_CAPS + 2)
00186 #define LUMINANCE_MODE     (NUM_CAPS + 3)
00187 
00188 #define NONE         0
00189 #define EQ        1
00190 #define NEQ       2
00191 #define LTE       3
00192 #define GTE       4
00193 #define GT        5
00194 #define LT        6
00195 #define MIN       7
00196 
00197 typedef struct _Criterion {
00198   int capability;
00199   int comparison;
00200   int value;
00201 } Criterion;
00202 
00203 typedef struct _FrameBufferMode {
00204   XVisualInfo *vi;
00205 #if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
00206 
00207   
00208 
00209 
00210 
00211 
00212 
00213 
00214 
00215 
00216   GLXFBConfigSGIX fbc;
00217 #endif
00218   int valid;
00219   int cap[NUM_CAPS];
00220 } FrameBufferMode;
00221 
00222 
00223 #define DM_WIDTH        0  
00224 #define DM_HEIGHT       1  
00225 #define DM_PIXEL_DEPTH  2  
00226 #define DM_HERTZ        3  
00227 #define DM_NUM          4  
00228 
00229 #define NUM_DM_CAPS     (DM_NUM+1)
00230 
00231 typedef struct _DisplayMode {
00232 #ifdef _WIN32
00233   DEVMODE devmode;
00234 #else
00235   
00236 
00237 
00238 
00239 
00240 #endif
00241   int valid;
00242   int cap[NUM_DM_CAPS];
00243 } DisplayMode;
00244 
00245 
00246 typedef void (*GLUTdisplayCB) (void);
00247 typedef void (*GLUTreshapeCB) (int, int);
00248 typedef void (*GLUTkeyboardCB) (unsigned char, int, int);
00249 typedef void (*GLUTmouseCB) (int, int, int, int);
00250 typedef void (*GLUTmotionCB) (int, int);
00251 typedef void (*GLUTpassiveCB) (int, int);
00252 typedef void (*GLUTentryCB) (int);
00253 typedef void (*GLUTvisibilityCB) (int);
00254 typedef void (*GLUTwindowStatusCB) (int);
00255 typedef void (*GLUTidleCB) (void);
00256 typedef void (*GLUTtimerCB) (int);
00257 typedef void (*GLUTmenuStateCB) (int);  
00258 typedef void (*GLUTmenuStatusCB) (int, int, int);
00259 typedef void (*GLUTselectCB) (int);
00260 typedef void (*GLUTspecialCB) (int, int, int);
00261 typedef void (*GLUTspaceMotionCB) (int, int, int);
00262 typedef void (*GLUTspaceRotateCB) (int, int, int);
00263 typedef void (*GLUTspaceButtonCB) (int, int);
00264 typedef void (*GLUTdialsCB) (int, int);
00265 typedef void (*GLUTbuttonBoxCB) (int, int);
00266 typedef void (*GLUTtabletMotionCB) (int, int);
00267 typedef void (*GLUTtabletButtonCB) (int, int, int, int);
00268 typedef void (*GLUTwacomMotionCB) (int, int, float, float, float, float, float, int);
00269 typedef void (*GLUTwacomButtonCB) (int, int, int, int, float, float, float, float, float, int);
00270 typedef void (*GLUTmoveCB) (int, int);
00271 typedef void (*GLUTjoystickCB) (unsigned int buttonMask, int x, int y, int z);
00272 #ifdef SUPPORT_FORTRAN
00273 typedef void (*GLUTdisplayFCB) (void);
00274 typedef void (*GLUTreshapeFCB) (int *, int *);
00275 
00276 typedef void (*GLUTkeyboardFCB) (int *, int *, int *);
00277 typedef void (*GLUTmouseFCB) (int *, int *, int *, int *);
00278 typedef void (*GLUTmotionFCB) (int *, int *);
00279 typedef void (*GLUTpassiveFCB) (int *, int *);
00280 typedef void (*GLUTentryFCB) (int *);
00281 typedef void (*GLUTvisibilityFCB) (int *);
00282 typedef void (*GLUTwindowStatusFCB) (int *);
00283 typedef void (*GLUTidleFCB) (void);
00284 typedef void (*GLUTtimerFCB) (int *);
00285 typedef void (*GLUTmenuStateFCB) (int *);  
00286 typedef void (*GLUTmenuStatusFCB) (int *, int *, int *);
00287 typedef void (*GLUTselectFCB) (int *);
00288 typedef void (*GLUTspecialFCB) (int *, int *, int *);
00289 typedef void (*GLUTspaceMotionFCB) (int *, int *, int *);
00290 typedef void (*GLUTspaceRotateFCB) (int *, int *, int *);
00291 typedef void (*GLUTspaceButtonFCB) (int *, int *);
00292 typedef void (*GLUTdialsFCB) (int *, int *);
00293 typedef void (*GLUTbuttonBoxFCB) (int *, int *);
00294 typedef void (*GLUTtabletMotionFCB) (int *, int *);
00295 typedef void (*GLUTtabletButtonFCB) (int *, int *, int *, int *);
00296 typedef void (*GLUTjoystickFCB) (unsigned int *buttonMask, int *x, int *y, int *z);
00297 #endif
00298 
00299 typedef struct _GLUTcolorcell GLUTcolorcell;
00300 struct _GLUTcolorcell {
00301   
00302   GLfloat component[3];
00303 };
00304 
00305 typedef struct _GLUTcolormap GLUTcolormap;
00306 struct _GLUTcolormap {
00307   Visual *visual;       
00308   Colormap cmap;        
00309   int refcnt;           
00310   int size;             
00311   int transparent;      
00312   GLUTcolorcell *cells; 
00313   GLUTcolormap *next;   
00314 };
00315 
00316 typedef struct _GLUTwindow GLUTwindow;
00317 typedef struct _GLUToverlay GLUToverlay;
00318 struct _GLUTwindow {
00319   int num;              
00320 
00321   
00322 #if defined(_WIN32)
00323   int pf;               
00324   HDC hdc;              
00325 #endif
00326   Window win;           
00327   GLXContext ctx;       
00328   XVisualInfo *vis;     
00329   Bool visAlloced;      
00330   Colormap cmap;        
00331   GLUTcolormap *colormap;  
00332   GLUToverlay *overlay; 
00333 #if defined(_WIN32)
00334   HDC renderDc;         
00335 #endif
00336   Window renderWin;     
00337 
00338   GLXContext renderCtx; 
00339 
00340   
00341               
00342               
00343   
00344 
00345   int width;            
00346   int height;           
00347   int cursor;           
00348   int visState;         
00349   int shownState;       
00350   int entryState;       
00351 #define GLUT_MAX_MENUS              3
00352 
00353   int menu[GLUT_MAX_MENUS];  
00354   
00355   GLUTwindow *parent;   
00356   GLUTwindow *children; 
00357   GLUTwindow *siblings; 
00358   
00359   Bool treatAsSingle;   
00360 
00361   Bool forceReshape;    
00362 #if !defined(_WIN32)
00363   Bool isDirect;        
00364 #endif
00365   Bool usedSwapBuffers; 
00366   long eventMask;       
00367   int buttonUses;       
00368   int tabletPos[2];     
00369   
00370   unsigned int workMask;  
00371   GLUTwindow *prevWorkWin;  
00372   Bool desiredMapState; 
00373 
00374   Bool ignoreKeyRepeat;  
00375   int desiredConfMask;  
00376 
00377   int desiredX;         
00378   int desiredY;         
00379   int desiredWidth;     
00380   int desiredHeight;    
00381   int desiredStack;     
00382   
00383   GLUTdisplayCB display;  
00384   GLUTreshapeCB reshape;  
00385   GLUTmouseCB mouse;    
00386   GLUTmotionCB motion;  
00387   GLUTpassiveCB passive;  
00388   GLUTentryCB entry;    
00389   GLUTkeyboardCB keyboard;  
00390   GLUTkeyboardCB keyboardUp;  
00391   GLUTwindowStatusCB windowStatus;  
00392   GLUTvisibilityCB visibility;  
00393   GLUTspecialCB special;  
00394   GLUTspecialCB specialUp;  
00395   GLUTbuttonBoxCB buttonBox;  
00396   GLUTdialsCB dials;    
00397   GLUTspaceMotionCB spaceMotion;  
00398   GLUTspaceRotateCB spaceRotate;  
00399   GLUTspaceButtonCB spaceButton;  
00400   GLUTtabletMotionCB tabletMotion;  
00401   GLUTtabletButtonCB tabletButton;  
00402   GLUTwacomMotionCB wacomMotion;  
00403   GLUTwacomButtonCB wacomButton;  
00404   GLUTmoveCB move;   
00405   int x, y;          
00406 #ifdef _WIN32
00407   GLUTjoystickCB joystick;  
00408   int joyPollInterval; 
00409 #endif
00410 #ifdef SUPPORT_FORTRAN
00411   
00412 
00413   GLUTreshapeFCB freshape;  
00414   GLUTmouseFCB fmouse;  
00415   GLUTmotionFCB fmotion;  
00416   GLUTpassiveFCB fpassive;  
00417   GLUTentryFCB fentry;  
00418   GLUTkeyboardFCB fkeyboard;  
00419   GLUTkeyboardFCB fkeyboardUp;  
00420   GLUTwindowStatusFCB fwindowStatus;  
00421 
00422   GLUTvisibilityFCB fvisibility;  
00423 
00424   GLUTspecialFCB fspecial;  
00425   GLUTspecialFCB fspecialUp;  
00426   GLUTbuttonBoxFCB fbuttonBox;  
00427   GLUTdialsFCB fdials;  
00428   GLUTspaceMotionFCB fspaceMotion;  
00429 
00430   GLUTspaceRotateFCB fspaceRotate;  
00431 
00432   GLUTspaceButtonFCB fspaceButton;  
00433 
00434   GLUTtabletMotionFCB ftabletMotion;  
00435 
00436   GLUTtabletButtonFCB ftabletButton;  
00437 
00438 #ifdef _WIN32
00439   GLUTjoystickFCB fjoystick;  
00440 #endif
00441 #endif
00442 };
00443 
00444 struct _GLUToverlay {
00445 #if defined(_WIN32)
00446   int pf;
00447   HDC hdc;
00448 #endif
00449   Window win;
00450   GLXContext ctx;
00451   XVisualInfo *vis;     
00452   Bool visAlloced;      
00453   Colormap cmap;        
00454   GLUTcolormap *colormap;  
00455   int shownState;       
00456   Bool treatAsSingle;   
00457 #if !defined(_WIN32)
00458   Bool isDirect;        
00459 #endif
00460   int transparentPixel; 
00461   GLUTdisplayCB display;  
00462   
00463 
00464 };
00465 
00466 typedef struct _GLUTstale GLUTstale;
00467 struct _GLUTstale {
00468   GLUTwindow *window;
00469   Window win;
00470   GLUTstale *next;
00471 };
00472 
00473 extern GLUTstale *__glutStaleWindowList;
00474 
00475 #define GLUT_OVERLAY_EVENT_FILTER_MASK \
00476   (ExposureMask | \
00477   StructureNotifyMask | \
00478   EnterWindowMask | \
00479   LeaveWindowMask)
00480 #define GLUT_DONT_PROPAGATE_FILTER_MASK \
00481   (ButtonReleaseMask | \
00482   ButtonPressMask | \
00483   KeyPressMask | \
00484   KeyReleaseMask | \
00485   PointerMotionMask | \
00486   Button1MotionMask | \
00487   Button2MotionMask | \
00488   Button3MotionMask)
00489 #define GLUT_HACK_STOP_PROPAGATE_MASK \
00490   (KeyPressMask | \
00491   KeyReleaseMask)
00492 
00493 typedef struct _GLUTmenu GLUTmenu;
00494 typedef struct _GLUTmenuItem GLUTmenuItem;
00495 struct _GLUTmenu {
00496   int id;               
00497   Window win;           
00498   GLUTselectCB select;  
00499   GLUTmenuItem *list;   
00500   int num;              
00501 #if !defined(_WIN32)
00502   Bool managed;         
00503 
00504   Bool searched;  
00505   int pixheight;        
00506   int pixwidth;         
00507 #endif
00508   int submenus;         
00509   GLUTmenuItem *highlighted;  
00510 
00511   GLUTmenu *cascade;    
00512   GLUTmenuItem *anchor; 
00513   int x;                
00514 
00515   int y;                
00516 
00517 #ifdef SUPPORT_FORTRAN
00518   GLUTselectFCB fselect;  
00519 #endif
00520 };
00521 
00522 struct _GLUTmenuItem {
00523   Window win;           
00524   GLUTmenu *menu;       
00525   Bool isTrigger;       
00526   int value;            
00527 
00528 
00529 #if defined(_WIN32)
00530   UINT unique;          
00531 #endif
00532   char *label;          
00533   int len;              
00534   int pixwidth;         
00535   GLUTmenuItem *next;   
00536 };
00537 
00538 typedef struct _GLUTtimer GLUTtimer;
00539 struct _GLUTtimer {
00540   GLUTtimer *next;      
00541   struct timeval timeout;  
00542   GLUTtimerCB func;     
00543   int value;            
00544 #ifdef SUPPORT_FORTRAN
00545   GLUTtimerFCB ffunc;   
00546 #endif
00547 };
00548 
00549 typedef struct _GLUTeventParser GLUTeventParser;
00550 struct _GLUTeventParser {
00551   int (*func) (XEvent *);
00552   GLUTeventParser *next;
00553 };
00554 
00555 
00556 
00557 
00558 
00559 
00560 
00561 
00562 
00563 typedef struct {
00564 #define MWM_HINTS_DECORATIONS   2
00565   long flags;
00566   long functions;
00567   long decorations;
00568   long input_mode;
00569 } MotifWmHints;
00570 
00571 
00572 #ifdef _WIN32
00573 #define MAKE_CURRENT_LAYER(window)                                    \
00574   {                                                                   \
00575     HGLRC currentContext = wglGetCurrentContext();                    \
00576     HDC currentDc = wglGetCurrentDC();                                \
00577                                                                       \
00578     if (currentContext != window->renderCtx                           \
00579       || currentDc != window->renderDc) {                             \
00580       wglMakeCurrent(window->renderDc, window->renderCtx);            \
00581     }                                                                 \
00582   }
00583 #define MAKE_CURRENT_WINDOW(window)                                   \
00584   {                                                                   \
00585     HGLRC currentContext = wglGetCurrentContext();                    \
00586     HDC currentDc = wglGetCurrentDC();                                \
00587                                                                       \
00588     if (currentContext != window->ctx || currentDc != window->hdc) {  \
00589       wglMakeCurrent(window->hdc, window->ctx);                       \
00590     }                                                                 \
00591   }
00592 #define MAKE_CURRENT_OVERLAY(overlay) \
00593   wglMakeCurrent(overlay->hdc, overlay->ctx)
00594 #define UNMAKE_CURRENT() \
00595   wglMakeCurrent(NULL, NULL)
00596 #define SWAP_BUFFERS_WINDOW(window) \
00597   SwapBuffers(window->hdc)
00598 #define SWAP_BUFFERS_LAYER(window) \
00599   SwapBuffers(window->renderDc)
00600 #else
00601 #define MAKE_CURRENT_LAYER(window) \
00602   glXMakeCurrent(__glutDisplay, window->renderWin, window->renderCtx)
00603 #define MAKE_CURRENT_WINDOW(window) \
00604   glXMakeCurrent(__glutDisplay, window->win, window->ctx)
00605 #define MAKE_CURRENT_OVERLAY(overlay) \
00606   glXMakeCurrent(__glutDisplay, overlay->win, overlay->ctx)
00607 #define UNMAKE_CURRENT() \
00608   glXMakeCurrent(__glutDisplay, None, NULL)
00609 #define SWAP_BUFFERS_WINDOW(window) \
00610   glXSwapBuffers(__glutDisplay, window->win)
00611 #define SWAP_BUFFERS_LAYER(window) \
00612   glXSwapBuffers(__glutDisplay, window->renderWin)
00613 #endif
00614 
00615 
00616 extern GLUTwindow *__glutWindowWorkList;
00617 extern int __glutWindowDamaged;
00618 #ifdef SUPPORT_FORTRAN
00619 extern GLUTtimer *__glutTimerList;
00620 extern GLUTtimer *__glutNewTimer;
00621 #endif
00622 extern GLUTmenu *__glutMappedMenu;
00623 
00624 extern void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *);
00625 #if !defined(_WIN32)
00626 extern void (*__glutMenuItemEnterOrLeave)(GLUTmenuItem * item,
00627   int num, int type);
00628 extern void (*__glutFinishMenu)(Window win, int x, int y);
00629 extern void (*__glutPaintMenu)(GLUTmenu * menu);
00630 extern void (*__glutStartMenu)(GLUTmenu * menu,
00631   GLUTwindow * window, int x, int y, int x_win, int y_win);
00632 extern GLUTmenu * (*__glutGetMenuByNum)(int menunum);
00633 extern GLUTmenuItem * (*__glutGetMenuItem)(GLUTmenu * menu,
00634   Window win, int *which);
00635 extern GLUTmenu * (*__glutGetMenu)(Window win);
00636 #endif
00637 
00638 
00639 extern Atom __glutWMDeleteWindow;
00640 extern Display *__glutDisplay;
00641 extern unsigned int __glutDisplayMode;
00642 extern char *__glutDisplayString;
00643 extern XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle,
00644   Criterion * requiredCriteria, int nRequired, int requiredMask, void **fbc);
00645 extern GLboolean __glutDebug;
00646 extern GLboolean __glutForceDirect;
00647 extern GLboolean __glutIconic;
00648 extern GLboolean __glutTryDirect;
00649 extern Window __glutRoot;
00650 extern XSizeHints __glutSizeHints;
00651 extern char **__glutArgv;
00652 extern char *__glutProgramName;
00653 extern int __glutArgc;
00654 extern int __glutConnectionFD;
00655 extern int __glutInitHeight;
00656 extern int __glutInitWidth;
00657 extern int __glutInitX;
00658 extern int __glutInitY;
00659 extern int __glutScreen;
00660 extern int __glutScreenHeight;
00661 extern int __glutScreenWidth;
00662 extern Atom __glutMotifHints;
00663 extern unsigned int __glutModifierMask;
00664 
00665 
00666 extern GLUTmenuItem *__glutItemSelected;
00667 extern GLUTmenu **__glutMenuList;
00668 extern void (*__glutMenuStatusFunc) (int, int, int);
00669 extern void __glutMenuModificationError(void);
00670 extern void __glutSetMenuItem(GLUTmenuItem * item,
00671   const char *label, int value, Bool isTrigger);
00672 
00673 
00674 extern int __glutWacomButton;
00675 extern int __glutWacomState;
00676 extern float __glutWacomX, __glutWacomY;
00677 extern float __glutWacomPressure;
00678 extern float __glutWacomXTilt, __glutWacomYTilt;
00679 
00680 
00681 extern GLUTwindow **__glutWindowList;
00682 extern GLUTwindow *__glutCurrentWindow;
00683 extern GLUTwindow *__glutMenuWindow;
00684 extern GLUTmenu *__glutCurrentMenu;
00685 extern int __glutWindowListSize;
00686 extern void (*__glutFreeOverlayFunc) (GLUToverlay *);
00687 extern XVisualInfo *__glutDetermineWindowVisual(Bool * treatAsSingle,
00688   Bool * visAlloced, void **fbc);
00689 
00690 
00691 extern int __glutMesaSwapHackSupport;
00692 
00693 
00694 extern GLUTwindow *__glutGameModeWindow;
00695 
00696 
00697 extern GLUTcolormap * __glutAssociateNewColormap(XVisualInfo * vis);
00698 extern void __glutFreeColormap(GLUTcolormap *);
00699 
00700 
00701 extern void __glutSetupColormap(
00702   XVisualInfo * vi,
00703   GLUTcolormap ** colormap,
00704   Colormap * cmap);
00705 #if !defined(_WIN32)
00706 extern void __glutEstablishColormapsProperty(
00707   GLUTwindow * window);
00708 extern GLUTwindow *__glutToplevelOf(GLUTwindow * window);
00709 #endif
00710 
00711 
00712 extern void __glutSetCursor(GLUTwindow *window);
00713 
00714 
00715 extern void __glutPutOnWorkList(GLUTwindow * window,
00716   int work_mask);
00717 extern void __glutRegisterEventParser(GLUTeventParser * parser);
00718 extern void __glutPostRedisplay(GLUTwindow * window, int layerMask);
00719 
00720 
00721 #if !defined(_WIN32)
00722 extern void __glutOpenXConnection(char *display);
00723 #else
00724 extern void __glutOpenWin32Connection(char *display);
00725 #endif
00726 extern void __glutInitTime(struct timeval *beginning);
00727 
00728 
00729 #if defined(_WIN32)
00730 extern GLUTmenu *__glutGetMenu(Window win);
00731 extern GLUTmenu *__glutGetMenuByNum(int menunum);
00732 extern GLUTmenuItem *__glutGetMenuItem(GLUTmenu * menu,
00733   Window win, int *which);
00734 extern void __glutStartMenu(GLUTmenu * menu,
00735   GLUTwindow * window, int x, int y, int x_win, int y_win);
00736 extern void __glutFinishMenu(Window win, int x, int y);
00737 #endif
00738 extern void __glutSetMenu(GLUTmenu * menu);
00739 
00740 
00741 extern char * __glutStrdup(const char *string);
00742 extern void __glutWarning(char *format,...);
00743 extern void __glutFatalError(char *format,...);
00744 extern void __glutFatalUsage(char *format,...);
00745 
00746 
00747 extern void __glutWacomSetOffset(int x, int y);
00748 extern void __glutWacomSetButton(int device, int button);
00749 extern void __glutWacomUpdate(int x, int y, int pressure, int xtilt, int ytilt);
00750 extern void __glutWacomCalibrate(void);
00751 
00752 
00753 extern GLUTwindow *__glutGetWindow(Window win);
00754 extern void __glutChangeWindowEventMask(long mask, Bool add);
00755 extern XVisualInfo *__glutDetermineVisual(
00756   unsigned int mode,
00757   Bool * fakeSingle,
00758   XVisualInfo * (getVisualInfo) (unsigned int));
00759 extern XVisualInfo *__glutGetVisualInfo(unsigned int mode);
00760 extern void __glutSetWindow(GLUTwindow * window);
00761 extern void __glutReshapeFunc(GLUTreshapeCB reshapeFunc,
00762   int callingConvention);
00763 extern void  __glutDefaultReshape(int, int);
00764 extern GLUTwindow *__glutCreateWindow(
00765   GLUTwindow * parent,
00766   int x, int y, int width, int height, int gamemode);
00767 extern void __glutDestroyWindow(
00768   GLUTwindow * window,
00769   GLUTwindow * initialWindow);
00770 
00771 #if !defined(_WIN32)
00772 
00773 extern int __glutIsSupportedByGLX(char *);
00774 #endif
00775 
00776 
00777 extern void  __glutUpdateInputDeviceMask(GLUTwindow * window);
00778 
00779 
00780 extern void __glutDetermineMesaSwapHackSupport(void);
00781 
00782 
00783 extern void __glutCloseDownGameMode(void);
00784 
00785 #if defined(_WIN32)
00786 
00787 extern LONG WINAPI __glutWindowProc(HWND win, UINT msg, WPARAM w, LPARAM l);
00788 extern HDC XHDC;
00789 #endif
00790 
00791 #endif