home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 5 / MA_Cover_5.iso / ppc / mesa / src-glut / glutint.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-31  |  21.8 KB  |  615 lines

  1. #ifndef __glutint_h__
  2. #define __glutint_h__
  3.  
  4. /* Copyright (c) Mark J. Kilgard, 1994. */
  5.  
  6. /* This program is freely distributable without licensing fees 
  7.    and is provided without guarantee or warrantee expressed or 
  8.    implied. This program is -not- in the public domain. */
  9.  
  10. #if defined(__CYGWIN32__)
  11. #include <sys/time.h>
  12. #endif
  13.  
  14. #if defined(WIN32)
  15. #include "glutwin32.h"
  16. #else /* WIN32 */
  17. #ifdef __sgi
  18. #define SUPPORT_FORTRAN
  19. #endif
  20. #include <X11/Xlib.h>
  21. #include <X11/Xutil.h>
  22. #include <GL/glx.h>
  23. #endif
  24. #include <GL/glut.h>
  25. #ifdef __vms
  26. struct timeval {
  27.   __int64 val;
  28. };
  29. extern int sys$gettim(struct timeval *);
  30. #else
  31. #include <sys/types.h>
  32. #if !defined(WIN32)
  33. #include <sys/time.h>
  34. #endif /* !WIN32 */
  35. #endif
  36. #if defined(__vms)
  37.  
  38. /* One TICK on VMS is 100 nanoseconds; 0.1 microseconds or
  39.    0.0001 milliseconds. This means that there are 0.01
  40.    ticks/ns, 10 ticks/us, 10,000 ticks/ms and 10,000,000
  41.    ticks/second. */
  42.  
  43. #define TICKS_PER_MILLISECOND 10000
  44. #define TICKS_PER_SECOND      10000000
  45.  
  46. #define GETTIMEOFDAY(_x) (void) sys$gettim (_x);
  47.  
  48. #define ADD_TIME(dest, src1, src2) { \
  49.   (dest).val = (src1).val + (src2).val; \
  50. }
  51.  
  52. #define TIMEDELTA(dest, src1, src2) { \
  53.   (dest).val = (src1).val - (src2).val; \
  54. }
  55.  
  56. #define IS_AFTER(t1, t2) ((t2).val > (t1).val)
  57.  
  58. #define IS_AT_OR_AFTER(t1, t2) ((t2).val >= (t1).val)
  59.  
  60. #else
  61. #if defined(SVR4) && !defined(sun)  /* Sun claims SVR4, but
  62.                                        wants 2 args. */
  63. #define GETTIMEOFDAY(_x) gettimeofday(_x)
  64. #else
  65. #define GETTIMEOFDAY(_x) gettimeofday(_x, (struct timezone*) NULL)
  66. #endif
  67. #define ADD_TIME(dest, src1, src2) { \
  68.   if(((dest).tv_usec = \
  69.     (src1).tv_usec + (src2).tv_usec) >= 1000000) { \
  70.     (dest).tv_usec -= 1000000; \
  71.     (dest).tv_sec = (src1).tv_sec + (src2).tv_sec + 1; \
  72.   } else { \
  73.     (dest).tv_sec = (src1).tv_sec + (src2).tv_sec; \
  74.     if(((dest).tv_sec >= 1) && (((dest).tv_usec <0))) { \
  75.       (dest).tv_sec --;(dest).tv_usec += 1000000; \
  76.     } \
  77.   } \
  78. }
  79. #define TIMEDELTA(dest, src1, src2) { \
  80.   if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \
  81.     (dest).tv_usec += 1000000; \
  82.     (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \
  83.   } else { \
  84.      (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \
  85.   } \
  86. }
  87. #define IS_AFTER(t1, t2) \
  88.   (((t2).tv_sec > (t1).tv_sec) || \
  89.   (((t2).tv_sec == (t1).tv_sec) && \
  90.   ((t2).tv_usec > (t1).tv_usec)))
  91. #define IS_AT_OR_AFTER(t1, t2) \
  92.   (((t2).tv_sec > (t1).tv_sec) || \
  93.   (((t2).tv_sec == (t1).tv_sec) && \
  94.   ((t2).tv_usec >= (t1).tv_usec)))
  95. #endif
  96. #define GLUT_WIND_IS_RGB(x)         (((x) & GLUT_INDEX) == 0)
  97. #define GLUT_WIND_IS_INDEX(x)       (((x) & GLUT_INDEX) != 0)
  98. #define GLUT_WIND_IS_SINGLE(x)      (((x) & GLUT_DOUBLE) == 0)
  99. #define GLUT_WIND_IS_DOUBLE(x)      (((x) & GLUT_DOUBLE) != 0)
  100. #define GLUT_WIND_HAS_ACCUM(x)      (((x) & GLUT_ACCUM) != 0)
  101. #define GLUT_WIND_HAS_ALPHA(x)      (((x) & GLUT_ALPHA) != 0)
  102. #define GLUT_WIND_HAS_DEPTH(x)      (((x) & GLUT_DEPTH) != 0)
  103. #define GLUT_WIND_HAS_STENCIL(x)    (((x) & GLUT_STENCIL) != 0)
  104. #define GLUT_WIND_IS_MULTISAMPLE(x) (((x) & GLUT_MULTISAMPLE) != 0)
  105. #define GLUT_WIND_IS_STEREO(x)      (((x) & GLUT_STEREO) != 0)
  106. #define GLUT_WIND_IS_LUMINANCE(x)   (((x) & GLUT_LUMINANCE) != 0)
  107. #define GLUT_MAP_WORK               (1 << 0)
  108. #define GLUT_EVENT_MASK_WORK        (1 << 1)
  109. #define GLUT_REDISPLAY_WORK         (1 << 2)
  110. #define GLUT_CONFIGURE_WORK         (1 << 3)
  111. #define GLUT_COLORMAP_WORK          (1 << 4)
  112. #define GLUT_DEVICE_MASK_WORK        (1 << 5)
  113. #define GLUT_FINISH_WORK        (1 << 6)
  114. #define GLUT_DEBUG_WORK            (1 << 7)
  115. #define GLUT_DUMMY_WORK            (1 << 8)
  116. #define GLUT_FULL_SCREEN_WORK       (1 << 9)
  117. #define GLUT_OVERLAY_REDISPLAY_WORK (1 << 10)
  118. #define GLUT_REPAIR_WORK            (1 << 11)
  119. #define GLUT_OVERLAY_REPAIR_WORK    (1 << 12)
  120.  
  121. /* Frame buffer capability macros and types. */
  122. #define BUFFER_SIZE             0
  123. #define RGBA                    1
  124. #define DOUBLEBUFFER            2
  125. #define STEREO                  3
  126. #define AUX_BUFFERS             4
  127. #define RED_SIZE                5  /* Used as mask bit for
  128.                                       "color selected". */
  129. #define GREEN_SIZE              6
  130. #define BLUE_SIZE               7
  131. #define ALPHA_SIZE              8
  132. #define DEPTH_SIZE              9
  133. #define STENCIL_SIZE            10
  134. #define ACCUM_RED_SIZE          11  /* Used as mask bit for
  135.                                        "acc selected". */
  136. #define ACCUM_GREEN_SIZE        12
  137. #define ACCUM_BLUE_SIZE         13
  138. #define ACCUM_ALPHA_SIZE        14
  139. #define LEVEL                   15
  140.  
  141. #define NUM_GLXCAPS             (LEVEL + 1)
  142.  
  143. #define XVISUAL                 (NUM_GLXCAPS + 0)
  144. #define TRANSPARENT             (NUM_GLXCAPS + 1)
  145. #define SAMPLES                 (NUM_GLXCAPS + 2)
  146. #define XSTATICGRAY             (NUM_GLXCAPS + 3)  /* Used as
  147.                                                       mask bit
  148.                                                       for "any
  149.                                                       visual type 
  150.                                                       selected". */
  151. #define XGRAYSCALE              (NUM_GLXCAPS + 4)
  152. #define XSTATICCOLOR            (NUM_GLXCAPS + 5)
  153. #define XPSEUDOCOLOR            (NUM_GLXCAPS + 6)
  154. #define XTRUECOLOR              (NUM_GLXCAPS + 7)
  155. #define XDIRECTCOLOR            (NUM_GLXCAPS + 8)
  156. #define SLOW                    (NUM_GLXCAPS + 9)
  157. #define CONFORMANT              (NUM_GLXCAPS + 10)
  158.  
  159. #define NUM_CAPS                (NUM_GLXCAPS + 11)
  160.  
  161. /* Frame buffer capablities that don't have a corresponding
  162.    FrameBufferMode entry.  These get used as mask bits. */
  163. #define NUM                     NUM_CAPS + 0
  164. #define RGBA_MODE               NUM_CAPS + 1
  165. #define CI_MODE                 NUM_CAPS + 2
  166.  
  167. #define NONE            0
  168. #define EQ            1
  169. #define NEQ            2
  170. #define LTE            3
  171. #define GTE            4
  172. #define GT            5
  173. #define LT            6
  174. #define MIN            7
  175.  
  176. typedef struct _Criterion {
  177.   int capability;
  178.   int comparison;
  179.   int value;
  180. } Criterion;
  181.  
  182. typedef struct _FrameBufferMode {
  183.   XVisualInfo *vi;
  184.   int valid;
  185.   int cap[NUM_CAPS];
  186. } FrameBufferMode;
  187.  
  188. /* GLUT  function types */
  189. typedef void (*GLUTdisplayCB) (void);
  190. typedef void (*GLUTreshapeCB) (int, int);
  191. typedef void (*GLUTkeyboardCB) (unsigned char, int, int);
  192. typedef void (*GLUTmouseCB) (int, int, int, int);
  193. typedef void (*GLUTmotionCB) (int, int);
  194. typedef void (*GLUTpassiveCB) (int, int);
  195. typedef void (*GLUTentryCB) (int);
  196. typedef void (*GLUTvisibilityCB) (int);
  197. typedef void (*GLUTwindowStatusCB) (int);
  198. typedef void (*GLUTidleCB) (void);
  199. typedef void (*GLUTtimerCB) (int);
  200. typedef void (*GLUTmenuStateCB) (int);  /* DEPRICATED. 
  201.                                                    */
  202. typedef void (*GLUTmenuStatusCB) (int, int, int);
  203. typedef void (*GLUTselectCB) (int);
  204. typedef void (*GLUTspecialCB) (int, int, int);
  205. typedef void (*GLUTspaceMotionCB) (int, int, int);
  206. typedef void (*GLUTspaceRotateCB) (int, int, int);
  207. typedef void (*GLUTspaceButtonCB) (int, int);
  208. typedef void (*GLUTdialsCB) (int, int);
  209. typedef void (*GLUTbuttonBoxCB) (int, int);
  210. typedef void (*GLUTtabletMotionCB) (int, int);
  211. typedef void (*GLUTtabletButtonCB) (int, int, int, int);
  212. #ifdef SUPPORT_FORTRAN
  213. typedef void (*GLUTdisplayFCB) (void);
  214. typedef void (*GLUTreshapeFCB) (int *, int *);
  215. /* NOTE the pressed key is int, not unsigned char for Fortran! */
  216. typedef void (*GLUTkeyboardFCB) (int *, int *, int *);
  217. typedef void (*GLUTmouseFCB) (int *, int *, int *, int *);
  218. typedef void (*GLUTmotionFCB) (int *, int *);
  219. typedef void (*GLUTpassiveFCB) (int *, int *);
  220. typedef void (*GLUTentryFCB) (int *);
  221. typedef void (*GLUTvisibilityFCB) (int *);
  222. typedef void (*GLUTwindowStatusFCB) (int *);
  223. typedef void (*GLUTidleFCB) (void);
  224. typedef void (*GLUTtimerFCB) (int *);
  225. typedef void (*GLUTmenuStateFCB) (int *);  /* DEPRICATED. */
  226. typedef void (*GLUTmenuStatusFCB) (int *, int *, int *);
  227. typedef void (*GLUTselectFCB) (int *);
  228. typedef void (*GLUTspecialFCB) (int *, int *, int *);
  229. typedef void (*GLUTspaceMotionFCB) (int *, int *, int *);
  230. typedef void (*GLUTspaceRotateFCB) (int *, int *, int *);
  231. typedef void (*GLUTspaceButtonFCB) (int *, int *);
  232. typedef void (*GLUTdialsFCB) (int *, int *);
  233. typedef void (*GLUTbuttonBoxFCB) (int *, int *);
  234. typedef void (*GLUTtabletMotionFCB) (int *, int *);
  235. typedef void (*GLUTtabletButtonFCB) (int *, int *, int *, int *);
  236. #endif
  237.  
  238. typedef struct _GLUTcolorcell GLUTcolorcell;
  239. struct _GLUTcolorcell {
  240.   /* GLUT_RED, GLUT_GREEN, GLUT_BLUE */
  241.   GLfloat component[3];
  242. };
  243.  
  244. typedef struct _GLUTcolormap GLUTcolormap;
  245. struct _GLUTcolormap {
  246.   Visual *visual;       /* visual of the colormap */
  247.   Colormap cmap;        /* X colormap ID */
  248.   int refcnt;           /* number of windows using colormap */
  249.   int size;             /* number of cells in colormap */
  250.   int transparent;      /* transparent pixel, or -1 if opaque */
  251.   GLUTcolorcell *cells; /* array of cells */
  252.   GLUTcolormap *next;   /* next colormap in list */
  253. };
  254.  
  255. typedef struct _GLUTwindow GLUTwindow;
  256. typedef struct _GLUToverlay GLUToverlay;
  257. struct _GLUTwindow {
  258.   int num;              /* small integer window id (0-based) */
  259.  
  260.   /* Window system related state. */
  261. #if defined(WIN32)
  262.   int pf;               /* pixel format */
  263.   HDC hdc;
  264. #endif
  265.   Window win;           /* X window for GLUT window */
  266.   GLXContext ctx;       /* OpenGL context GLUT glut window */
  267.   XVisualInfo *vis;     /* visual for window */
  268.   Bool visAlloced;      /* if vis needs deallocate on destroy */
  269.   Colormap cmap;        /* RGB colormap for window; None if CI */
  270.   GLUTcolormap *colormap;  /* colormap; NULL if RGBA */
  271.   GLUToverlay *overlay; /* overlay; NULL if no overlay */
  272.   Window renderWin;     /* X window for rendering (might be
  273.                            overlay) */
  274.   GLXContext renderCtx; /* OpenGL context for rendering (might
  275.                            be overlay) */
  276.   /* GLUT settable or visible window state. */
  277.   int width;            /* window width in pixels */
  278.   int height;           /* window height in pixels */
  279.   int cursor;           /* cursor name */
  280.   int visState;         /* visibility state (-1 is unknown) */
  281.   int shownState;       /* if window mapped */
  282.   int entryState;       /* entry state (-1 is unknown) */
  283. #define GLUT_MAX_MENUS              3
  284.  
  285.   int menu[GLUT_MAX_MENUS];  /* attatched menu nums */
  286.   /* Window relationship state. */
  287.   GLUTwindow *parent;   /* parent window */
  288.   GLUTwindow *children; /* list of children */
  289.   GLUTwindow *siblings; /* list of siblings */
  290.   /* Misc. non-API visible (hidden) state. */
  291.   Bool treatAsSingle;   /* treat this window as single-buffered
  292.                            (it might be "fake" though) */
  293.   Bool forceReshape;    /* force reshape before display */
  294.   Bool isDirect;        /* if direct context */
  295.   Bool usedSwapBuffers; /* if swap buffers used last display */
  296.   long eventMask;       /* mask of X events selected for */
  297.   int buttonUses;       /* number of button uses, ref cnt */
  298.   int tabletPos[2];     /* tablet position (-1 is invalid) */
  299.   /* Work list related state. */
  300.   unsigned int workMask;  /* mask of window work to be done */
  301.   GLUTwindow *prevWorkWin;  /* link list of windows to work on */
  302.   Bool desiredMapState; /* how to mapped window if on map work
  303.                            list */
  304.   int desiredConfMask;  /* mask of desired window configuration 
  305.  
  306.                          */
  307.   int desiredX;         /* desired X location */
  308.   int desiredY;         /* desired Y location */
  309.   int desiredWidth;     /* desired window width */
  310.   int desiredHeight;    /* desired window height */
  311.   int desiredStack;     /* desired window stack */
  312.   /* s */
  313.   GLUTdisplayCB display;  /* redraw  */
  314.   GLUTreshapeCB reshape;  /* resize  (width,height) */
  315.   GLUTmouseCB mouse;    /* mouse  (button,state,x,y) */
  316.   GLUTmotionCB motion;  /* motion  (x,y) */
  317.   GLUTpassiveCB passive;  /* passive motion  (x,y) */
  318.   GLUTentryCB entry;    /* window entry/exit  (state) */
  319.   GLUTkeyboardCB keyboard;  /* keyboard  (ASCII,x,y) */
  320.   GLUTwindowStatusCB windowStatus;  /* visibility  */
  321.   GLUTvisibilityCB visibility;  /* visibility  */
  322.   GLUTspecialCB special;  /* special key  */
  323.   GLUTbuttonBoxCB buttonBox;  /* button box  */
  324.   GLUTdialsCB dials;    /* dials  */
  325.   GLUTspaceMotionCB spaceMotion;  /* Spaceball motion  */
  326.   GLUTspaceRotateCB spaceRotate;  /* Spaceball rotate  */
  327.   GLUTspaceButtonCB spaceButton;  /* Spaceball button  */
  328.   GLUTtabletMotionCB tabletMotion;  /* tablet motion  */
  329.   GLUTtabletButtonCB tabletButton;  /* tablet button  */
  330. #ifdef SUPPORT_FORTRAN
  331.   /* Special Fortran display  unneeded since no
  332.      parameters! */
  333.   GLUTreshapeFCB freshape;  /* Fortran reshape  */
  334.   GLUTmouseFCB fmouse;  /* Fortran mouse  */
  335.   GLUTmotionFCB fmotion;  /* Fortran motion  */
  336.   GLUTpassiveFCB fpassive;  /* Fortran passive  */
  337.   GLUTentryFCB fentry;  /* Fortran entry  */
  338.   GLUTkeyboardFCB fkeyboard;  /* Fortran keyboard  */
  339.   GLUTwindowStatusFCB fwindowStatus;  /* Fortran visibility
  340.                                           */
  341.   GLUTvisibilityFCB fvisibility;  /* Fortran visibility
  342.                                       */
  343.   GLUTspecialFCB fspecial;  /* special key  */
  344.   GLUTbuttonBoxFCB fbuttonBox;  /* button box  */
  345.   GLUTdialsFCB fdials;  /* dials  */
  346.   GLUTspaceMotionFCB fspaceMotion;  /* Spaceball motion
  347.                                         */
  348.   GLUTspaceRotateFCB fspaceRotate;  /* Spaceball rotate
  349.                                         */
  350.   GLUTspaceButtonFCB fspaceButton;  /* Spaceball button
  351.                                         */
  352.   GLUTtabletMotionFCB ftabletMotion;  /* tablet motion  
  353.  
  354.                                        */
  355.   GLUTtabletButtonFCB ftabletButton;  /* tablet button  
  356.  
  357.                                        */
  358. #endif
  359. };
  360.  
  361. struct _GLUToverlay {
  362. #if defined(WIN32)
  363.   int pf;
  364.   HDC hdc;
  365. #endif
  366.   Window win;
  367.   GLXContext ctx;
  368.   XVisualInfo *vis;     /* visual for window */
  369.   Bool visAlloced;      /* if vis needs deallocate on destroy */
  370.   Colormap cmap;        /* RGB colormap for window; None if CI */
  371.   GLUTcolormap *colormap;  /* colormap; NULL if RGBA */
  372.   int shownState;       /* if overlay window mapped */
  373.   Bool treatAsSingle;   /* treat as single-buffered */
  374.   Bool isDirect;        /* if direct context */
  375.   int transparentPixel; /* transparent pixel value */
  376.   GLUTdisplayCB display;  /* redraw  */
  377.   /* Special Fortran display  unneeded since no
  378.      parameters! */
  379. };
  380.  
  381. typedef struct _GLUTstale GLUTstale;
  382. struct _GLUTstale {
  383.   GLUTwindow *window;
  384.   Window win;
  385.   GLUTstale *next;
  386. };
  387.  
  388. extern GLUTstale *__glutStaleWindowList;
  389. #define GLUT_OVERLAY_EVENT_FILTER_MASK \
  390.   (ExposureMask | \
  391.   StructureNotifyMask | \
  392.   EnterWindowMask | \
  393.   LeaveWindowMask)
  394. #define GLUT_DONT_PROPAGATE_FILTER_MASK \
  395.   (ButtonReleaseMask | \
  396.   ButtonPressMask | \
  397.   KeyPressMask | \
  398.   KeyReleaseMask | \
  399.   PointerMotionMask | \
  400.   Button1MotionMask | \
  401.   Button2MotionMask | \
  402.   Button3MotionMask)
  403. #define GLUT_HACK_STOP_PROPAGATE_MASK \
  404.   (KeyPressMask | \
  405.   KeyReleaseMask)
  406. typedef struct _GLUTmenu GLUTmenu;
  407. typedef struct _GLUTmenuItem GLUTmenuItem;
  408. struct _GLUTmenu {
  409.   int id;               /* small integer menu id (0-based) */
  410.   Window win;           /* X window for the menu */
  411.   GLUTselectCB select;  /*  function of menu */
  412.   GLUTmenuItem *list;   /* list of menu entries */
  413.   int num;              /* number of entries */
  414.   Bool managed;         /* are the InputOnly windows size
  415.                            validated? */
  416.   int pixwidth;         /* width of menu in pixels */
  417.   int pixheight;        /* height of menu in pixels */
  418.   int submenus;         /* number of submenu entries */
  419.   GLUTmenuItem *highlighted;  /* pointer to highlighted menu
  420.                                  entry, NULL not highlighted */
  421.   GLUTmenu *cascade;    /* currently cascading this menu  */
  422.   GLUTmenuItem *anchor; /* currently anchored to this entry */
  423.   int x;                /* current x origin relative to the
  424.                            root window */
  425.   int y;                /* current y origin relative to the
  426.                            root window */
  427. #ifdef SUPPORT_FORTRAN
  428.   GLUTselectFCB fselect;  /*  function of menu */
  429. #endif
  430. };
  431.  
  432. struct _GLUTmenuItem {
  433.   Window win;           /* InputOnly X window for entry */
  434.   GLUTmenu *menu;       /* menu entry belongs to */
  435.   Bool isTrigger;       /* is a submenu trigger? */
  436.   int value;            /* value to return for selecting this
  437.                            entry; doubles as submenu id
  438.                            (0-base) if submenu trigger */
  439. #if defined(WIN32)
  440.   int unique;           /* unique menu item id (WIN32) */
  441. #endif
  442.   char *label;          /* __glutStrdup'ed label string */
  443.   int len;              /* length of label string */
  444.   int pixwidth;         /* width of X window in pixels */
  445.   GLUTmenuItem *next;   /* next menu entry on list for menu */
  446. };
  447.  
  448. typedef struct _GLUTtimer GLUTtimer;
  449. struct _GLUTtimer {
  450.   GLUTtimer *next;      /* list of timers */
  451.   struct timeval timeout;  /* time to be called */
  452.   GLUTtimerCB func;     /* timer  (value) */
  453.   int value;            /*  return value */
  454. #ifdef SUPPORT_FORTRAN
  455.   GLUTtimerFCB ffunc;   /* Fortran timer  */
  456. #endif
  457. };
  458.  
  459. typedef struct _GLUTeventParser GLUTeventParser;
  460. struct _GLUTeventParser {
  461.   int (*func) (XEvent *);
  462.   GLUTeventParser *next;
  463. };
  464.  
  465. /* Declarations to implement glutFullScreen support with
  466.    mwm/4Dwm. */
  467.  
  468. /* The following X property format is defined in Motif 1.1's
  469.    Xm/MwmUtils.h, but GLUT should not depend on that header
  470.    file. Note: Motif 1.2 expanded this structure with
  471.    uninteresting fields (to GLUT) so just stick with the
  472.    smaller Motif 1.1 structure. */
  473. typedef struct {
  474. #define MWM_HINTS_DECORATIONS   2
  475.   long flags;
  476.   long functions;
  477.   long decorations;
  478.   long input_mode;
  479. } MotifWmHints;
  480.  
  481. /* private variables from glut_event.c */
  482. extern GLUTwindow *__glutWindowWorkList;
  483. extern int __glutWindowDamaged;
  484. #ifdef SUPPORT_FORTRAN
  485. extern GLUTtimer *__glutTimerList;
  486. extern GLUTtimer *__glutNewTimer;
  487. #endif
  488.  
  489. /* private variables from glut_init.c */
  490. extern Atom __glutWMDeleteWindow;
  491. extern Display *__glutDisplay;
  492. extern unsigned int __glutDisplayMode;
  493. extern char *__glutDisplayString;
  494. extern XVisualInfo *(*__glutDetermineVisualFromString) (char *string, Bool * treatAsSingle,
  495.   Criterion * requiredCriteria, int nRequired, int requiredMask);
  496. extern GLboolean __glutDebug;
  497. extern GLboolean __glutForceDirect;
  498. extern GLboolean __glutIconic;
  499. extern GLboolean __glutTryDirect;
  500. extern Window __glutRoot;
  501. extern XSizeHints __glutSizeHints;
  502. extern char **__glutArgv;
  503. extern char *__glutProgramName;
  504. extern int __glutArgc;
  505. extern int __glutConnectionFD;
  506. extern int __glutInitHeight;
  507. extern int __glutInitWidth;
  508. extern int __glutInitX;
  509. extern int __glutInitY;
  510. extern int __glutScreen;
  511. extern int __glutScreenHeight;
  512. extern int __glutScreenWidth;
  513. extern Atom __glutMotifHints;
  514. extern unsigned int __glutModifierMask;
  515.  
  516. /* private variables from glut_menu.c */
  517. extern GLUTmenu *__glutCurrentMenu;
  518. extern GLUTmenuItem *__glutItemSelected;
  519. extern GLUTmenu *__glutMappedMenu;
  520. extern GLUTwindow *__glutMenuWindow;
  521. extern void (*__glutMenuStatusFunc) (int, int, int);
  522.  
  523. /* private variables from glut_win.c */
  524. extern GLUTwindow **__glutWindowList;
  525. extern GLUTwindow *__glutCurrentWindow;
  526. extern int __glutWindowListSize;
  527. extern void (*__glutFreeOverlayFunc) (GLUToverlay *);
  528. extern XVisualInfo *__glutDetermineWindowVisual(Bool * treatAsSingle,
  529.   Bool * visAlloced);
  530.  
  531. /* private variables from glut_mesa.c */
  532. extern int __glutMesaSwapHackSupport;
  533.  
  534. /* private routines from glut_cindex.c */
  535. extern GLUTcolormap *__glutAssociateColormap(XVisualInfo * vis);
  536. extern void __glutFreeColormap(GLUTcolormap *);
  537.  
  538. /* private routines from glut_event.c */
  539. extern void (*__glutUpdateInputDeviceMaskFunc) (GLUTwindow *);
  540. extern void __glutPutOnWorkList(GLUTwindow * window,
  541.   int work_mask);
  542. extern void __glutRegisterEventParser(GLUTeventParser * parser);
  543. extern void __glutPostRedisplay(GLUTwindow * window, int layerMask);
  544.  
  545. /* private routines from glut_init.c */
  546. #if !defined(WIN32)
  547. extern void __glutOpenXConnection(char *display);
  548. #else
  549. extern void __glutOpenWin32Connection(char *display);
  550. #endif
  551. extern void __glutInitTime(struct timeval *beginning);
  552.  
  553. /* private routines for glut_menu.c */
  554. extern GLUTmenu *__glutGetMenu(Window win);
  555. extern GLUTmenu *__glutGetMenuByNum(int menunum);
  556. extern GLUTmenuItem *__glutGetMenuItem(GLUTmenu * menu,
  557.   Window win, int *which);
  558. extern void __glutFinishMenu(Window win, int x, int y);
  559. extern void __glutMenuItemEnterOrLeave(GLUTmenuItem * item,
  560.   int num, int type);
  561. extern void __glutPaintMenu(GLUTmenu * menu);
  562. extern void __glutSetMenu(GLUTmenu * menu);
  563. extern void __glutStartMenu(GLUTmenu * menu,
  564.   GLUTwindow * window, int x, int y, int x_win, int y_win);
  565.  
  566. /* private routines from glut_util.c */
  567. extern char * __glutStrdup(const char *string);
  568. extern void __glutWarning(char *format,...);
  569. extern void __glutFatalError(char *format,...);
  570. extern void __glutFatalUsage(char *format,...);
  571.  
  572. /* private routines from glut_win.c */
  573. extern GLUTwindow *__glutGetWindow(Window win);
  574. extern GLUTwindow *__glutToplevelOf(GLUTwindow * window);
  575. extern void __glutChangeWindowEventMask(long mask, Bool add);
  576. extern void __glutEstablishColormapsProperty(
  577.   GLUTwindow * window);
  578. extern XVisualInfo *__glutDetermineVisual(
  579.   unsigned int mode,
  580.   Bool * fakeSingle,
  581.   XVisualInfo * (getVisualInfo) (unsigned int));
  582. extern XVisualInfo *__glutGetVisualInfo(unsigned int mode);
  583. extern void __glutSetWindow(GLUTwindow * window);
  584. extern void __glutReshapeFunc(GLUTreshapeCB reshapeFunc,
  585.   int callingConvention);
  586. extern void  __glutDefaultReshape(int, int);
  587. extern void __glutSetupColormap(
  588.   XVisualInfo * vi,
  589.   GLUTcolormap ** colormap,
  590.   Colormap * cmap,
  591.   int isRGB);
  592. extern GLUTwindow *__glutCreateWindow(
  593.   GLUTwindow * parent,
  594.   int x, int y, int width, int height);
  595. extern void __glutDestroyWindow(
  596.   GLUTwindow * window,
  597.   GLUTwindow * initialWindow);
  598.  
  599. /* private routines from glut_ext.c */
  600. extern int __glutIsSupportedByGLX(char *);
  601.  
  602. /* private routines from glut_input.c */
  603. extern void  __glutUpdateInputDeviceMask(GLUTwindow * window);
  604.  
  605. /* private routines from glut_mesa.c */
  606. extern void __glutDetermineMesaSwapHackSupport(void);
  607.  
  608. #if defined(WIN32)
  609. /* private routines from glut_win32.c */
  610. extern LONG WINAPI __glutWindowProc(HWND win, UINT msg, WPARAM w, LPARAM l);
  611. extern HDC XHDC;
  612. #endif /* WIN32 */
  613.  
  614. #endif /* __glutint_h__ */
  615.