4 /* Copyright (c) Mark J. Kilgard, 1994, 1997, 1998. */
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. */
10 #if defined(__CYGWIN32__)
14 #define SUPPORT_FORTRAN /* With GLUT 3.7, everyone supports Fortran. */
17 #include "glutwin32.h"
20 #include <X11/Xutil.h>
24 #define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
27 #if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
28 #include <gl/mesa_wgl.h>
32 /* added by BrianP: */
34 #define APIENTRY GLAPIENTRY
36 #define __cdecl GLAPIENTRY
37 #define CDECL GLAPIENTRY
40 /* GLUT_BUILDING_LIB is used by <GL/glut.h> to 1) not #pragma link
41 with the GLUT library, and 2) avoid the Win32 atexit hack. */
43 /* This must be done after <GL/gl.h> is included. MESA is defined
44 if the <GL/gl.h> is supplied by Brian Paul's Mesa library. */
45 #if defined(MESA) && defined(_WIN32)
46 /* Mesa implements "wgl" versions of GDI entry points needed for
47 using OpenGL. Map these "wgl" versions to the GDI names via
49 #define ChoosePixelFormat wglChoosePixelFormat
50 #define DescribePixelFormat wglDescribePixelFormat
51 #define GetPixelFormat wglGetPixelFormat
52 #define SetPixelFormat wglSetPixelFormat
53 #define SwapBuffers wglSwapBuffers
54 #define GetCurrentContext wglGetCurrentContext
55 #define GetCurrentDC wglGetCurrentDC
56 #define MakeCurrent wglMakeCurrent
57 #define CreateContext wglCreateContext
58 #define DeleteContext wglDeleteContext
61 #ifdef SUPPORT_FORTRAN
62 #include <GL/glutf90.h>
66 #if ( __VMS_VER < 70000000 )
70 extern int sys$
gettim(struct timeval
*);
75 #include <sys/types.h>
76 #if !defined(_WIN32) || defined(__CYGWIN32__)
82 #if defined(__vms) && ( __VMS_VER < 70000000 )
84 /* For VMS6.2 or lower :
85 One TICK on VMS is 100 nanoseconds; 0.1 microseconds or
86 0.0001 milliseconds. This means that there are 0.01
87 ticks/ns, 10 ticks/us, 10,000 ticks/ms and 10,000,000
90 #define TICKS_PER_MILLISECOND 10000
91 #define TICKS_PER_SECOND 10000000
93 #define GETTIMEOFDAY(_x) (void) sys$gettim (_x);
95 #define ADD_TIME(dest, src1, src2) { \
96 (dest).val = (src1).val + (src2).val; \
99 #define TIMEDELTA(dest, src1, src2) { \
100 (dest).val = (src1).val - (src2).val; \
103 #define IS_AFTER(t1, t2) ((t2).val > (t1).val)
105 #define IS_AT_OR_AFTER(t1, t2) ((t2).val >= (t1).val)
108 #if defined(SVR4) && !defined(sun) /* Sun claims SVR4, but
110 #define GETTIMEOFDAY(_x) gettimeofday(_x)
112 #define GETTIMEOFDAY(_x) gettimeofday(_x, NULL)
114 #define ADD_TIME(dest, src1, src2) { \
115 if(((dest).tv_usec = \
116 (src1).tv_usec + (src2).tv_usec) >= 1000000) { \
117 (dest).tv_usec -= 1000000; \
118 (dest).tv_sec = (src1).tv_sec + (src2).tv_sec + 1; \
120 (dest).tv_sec = (src1).tv_sec + (src2).tv_sec; \
121 if(((dest).tv_sec >= 1) && (((dest).tv_usec <0))) { \
122 (dest).tv_sec --;(dest).tv_usec += 1000000; \
126 #define TIMEDELTA(dest, src1, src2) { \
127 if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \
128 (dest).tv_usec += 1000000; \
129 (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \
131 (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \
134 #define IS_AFTER(t1, t2) \
135 (((t2).tv_sec > (t1).tv_sec) || \
136 (((t2).tv_sec == (t1).tv_sec) && \
137 ((t2).tv_usec > (t1).tv_usec)))
138 #define IS_AT_OR_AFTER(t1, t2) \
139 (((t2).tv_sec > (t1).tv_sec) || \
140 (((t2).tv_sec == (t1).tv_sec) && \
141 ((t2).tv_usec >= (t1).tv_usec)))
144 #define IGNORE_IN_GAME_MODE() \
145 { if (__glutGameModeWindow) return; }
147 #define GLUT_WIND_IS_RGB(x) (((x) & GLUT_INDEX) == 0)
148 #define GLUT_WIND_IS_INDEX(x) (((x) & GLUT_INDEX) != 0)
149 #define GLUT_WIND_IS_SINGLE(x) (((x) & GLUT_DOUBLE) == 0)
150 #define GLUT_WIND_IS_DOUBLE(x) (((x) & GLUT_DOUBLE) != 0)
151 #define GLUT_WIND_HAS_ACCUM(x) (((x) & GLUT_ACCUM) != 0)
152 #define GLUT_WIND_HAS_ALPHA(x) (((x) & GLUT_ALPHA) != 0)
153 #define GLUT_WIND_HAS_DEPTH(x) (((x) & GLUT_DEPTH) != 0)
154 #define GLUT_WIND_HAS_STENCIL(x) (((x) & GLUT_STENCIL) != 0)
155 #define GLUT_WIND_IS_MULTISAMPLE(x) (((x) & GLUT_MULTISAMPLE) != 0)
156 #define GLUT_WIND_IS_STEREO(x) (((x) & GLUT_STEREO) != 0)
157 #define GLUT_WIND_IS_LUMINANCE(x) (((x) & GLUT_LUMINANCE) != 0)
158 #define GLUT_MAP_WORK (1 << 0)
159 #define GLUT_EVENT_MASK_WORK (1 << 1)
160 #define GLUT_REDISPLAY_WORK (1 << 2)
161 #define GLUT_CONFIGURE_WORK (1 << 3)
162 #define GLUT_COLORMAP_WORK (1 << 4)
163 #define GLUT_DEVICE_MASK_WORK (1 << 5)
164 #define GLUT_FINISH_WORK (1 << 6)
165 #define GLUT_DEBUG_WORK (1 << 7)
166 #define GLUT_DUMMY_WORK (1 << 8)
167 #define GLUT_FULL_SCREEN_WORK (1 << 9)
168 #define GLUT_OVERLAY_REDISPLAY_WORK (1 << 10)
169 #define GLUT_REPAIR_WORK (1 << 11)
170 #define GLUT_OVERLAY_REPAIR_WORK (1 << 12)
172 /* Frame buffer capability macros and types. */
174 #define BUFFER_SIZE 1
175 #define DOUBLEBUFFER 2
177 #define AUX_BUFFERS 4
178 #define RED_SIZE 5 /* Used as mask bit for
184 #define STENCIL_SIZE 10
185 #define ACCUM_RED_SIZE 11 /* Used as mask bit for
187 #define ACCUM_GREEN_SIZE 12
188 #define ACCUM_BLUE_SIZE 13
189 #define ACCUM_ALPHA_SIZE 14
192 #define NUM_GLXCAPS (LEVEL + 1)
194 #define XVISUAL (NUM_GLXCAPS + 0)
195 #define TRANSPARENT (NUM_GLXCAPS + 1)
196 #define SAMPLES (NUM_GLXCAPS + 2)
197 #define XSTATICGRAY (NUM_GLXCAPS + 3) /* Used as
202 #define XGRAYSCALE (NUM_GLXCAPS + 4)
203 #define XSTATICCOLOR (NUM_GLXCAPS + 5)
204 #define XPSEUDOCOLOR (NUM_GLXCAPS + 6)
205 #define XTRUECOLOR (NUM_GLXCAPS + 7)
206 #define XDIRECTCOLOR (NUM_GLXCAPS + 8)
207 #define SLOW (NUM_GLXCAPS + 9)
208 #define CONFORMANT (NUM_GLXCAPS + 10)
210 #define NUM_CAPS (NUM_GLXCAPS + 11)
212 /* Frame buffer capablities that don't have a corresponding
213 FrameBufferMode entry. These get used as mask bits. */
214 #define NUM (NUM_CAPS + 0)
215 #define RGBA_MODE (NUM_CAPS + 1)
216 #define CI_MODE (NUM_CAPS + 2)
217 #define LUMINANCE_MODE (NUM_CAPS + 3)
228 typedef struct _Criterion
{
234 typedef struct _FrameBufferMode
{
236 #if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
238 /* fbc is non-NULL when the XVisualInfo* is not OpenGL-capable
239 (ie, GLX_USE_GL is false), but the SGIX_fbconfig extension shows
240 the visual's fbconfig is OpenGL-capable. The reason for this is typically
241 an RGBA luminance fbconfig such as 16-bit StaticGray that could
242 not be advertised as a GLX visual since StaticGray visuals are
243 required (by the GLX specification) to be color index. The
244 SGIX_fbconfig allows StaticGray visuals to instead advertised as
245 fbconfigs that can provide RGBA luminance support. */
253 /* DisplayMode capability macros for game mode. */
254 #define DM_WIDTH 0 /* "width" */
255 #define DM_HEIGHT 1 /* "height" */
256 #define DM_PIXEL_DEPTH 2 /* "bpp" (bits per pixel) */
257 #define DM_HERTZ 3 /* "hertz" */
258 #define DM_NUM 4 /* "num" */
260 #define NUM_DM_CAPS (DM_NUM+1)
262 typedef struct _DisplayMode
{
266 /* XXX The X Window System does not have a standard
267 mechanism for display setting changes. On SGI
268 systems, GLUT could use the XSGIvc (SGI X video
269 control extension). Perhaps this can be done in
270 a future release of GLUT. */
273 int cap
[NUM_DM_CAPS
];
276 /* GLUT function types */
277 typedef void (GLUTCALLBACK
*GLUTdisplayCB
) (void);
278 typedef void (GLUTCALLBACK
*GLUTreshapeCB
) (int, int);
279 typedef void (GLUTCALLBACK
*GLUTkeyboardCB
) (unsigned char, int, int);
280 typedef void (GLUTCALLBACK
*GLUTmouseCB
) (int, int, int, int);
281 typedef void (GLUTCALLBACK
*GLUTmotionCB
) (int, int);
282 typedef void (GLUTCALLBACK
*GLUTpassiveCB
) (int, int);
283 typedef void (GLUTCALLBACK
*GLUTentryCB
) (int);
284 typedef void (GLUTCALLBACK
*GLUTvisibilityCB
) (int);
285 typedef void (GLUTCALLBACK
*GLUTwindowStatusCB
) (int);
286 typedef void (GLUTCALLBACK
*GLUTidleCB
) (void);
287 typedef void (GLUTCALLBACK
*GLUTtimerCB
) (int);
288 typedef void (GLUTCALLBACK
*GLUTmenuStateCB
) (int); /* DEPRICATED. */
289 typedef void (GLUTCALLBACK
*GLUTmenuStatusCB
) (int, int, int);
290 typedef void (GLUTCALLBACK
*GLUTselectCB
) (int);
291 typedef void (GLUTCALLBACK
*GLUTspecialCB
) (int, int, int);
292 typedef void (GLUTCALLBACK
*GLUTspaceMotionCB
) (int, int, int);
293 typedef void (GLUTCALLBACK
*GLUTspaceRotateCB
) (int, int, int);
294 typedef void (GLUTCALLBACK
*GLUTspaceButtonCB
) (int, int);
295 typedef void (GLUTCALLBACK
*GLUTdialsCB
) (int, int);
296 typedef void (GLUTCALLBACK
*GLUTbuttonBoxCB
) (int, int);
297 typedef void (GLUTCALLBACK
*GLUTtabletMotionCB
) (int, int);
298 typedef void (GLUTCALLBACK
*GLUTtabletButtonCB
) (int, int, int, int);
299 typedef void (GLUTCALLBACK
*GLUTjoystickCB
) (unsigned int buttonMask
, int x
, int y
, int z
);
301 typedef struct _GLUTcolorcell GLUTcolorcell
;
302 struct _GLUTcolorcell
{
303 /* GLUT_RED, GLUT_GREEN, GLUT_BLUE */
304 GLfloat component
[3];
307 typedef struct _GLUTcolormap GLUTcolormap
;
308 struct _GLUTcolormap
{
309 Visual
*visual
; /* visual of the colormap */
310 Colormap cmap
; /* X colormap ID */
311 int refcnt
; /* number of windows using colormap */
312 int size
; /* number of cells in colormap */
313 int transparent
; /* transparent pixel, or -1 if opaque */
314 GLUTcolorcell
*cells
; /* array of cells */
315 GLUTcolormap
*next
; /* next colormap in list */
318 typedef struct _GLUTwindow GLUTwindow
;
319 typedef struct _GLUToverlay GLUToverlay
;
321 int num
; /* Small integer window id (0-based). */
323 /* Window system related state. */
325 int pf
; /* Pixel format. */
326 HDC hdc
; /* Window's Win32 device context. */
328 Window win
; /* X window for GLUT window */
329 GLXContext ctx
; /* OpenGL context GLUT glut window */
330 XVisualInfo
*vis
; /* visual for window */
331 Bool visAlloced
; /* if vis needs deallocate on destroy */
332 Colormap cmap
; /* RGB colormap for window; None if CI */
333 GLUTcolormap
*colormap
; /* colormap; NULL if RGBA */
334 GLUToverlay
*overlay
; /* overlay; NULL if no overlay */
336 HDC renderDc
; /* Win32's device context for rendering. */
338 Window renderWin
; /* X window for rendering (might be
340 GLXContext renderCtx
; /* OpenGL context for rendering (might
342 /* GLUT settable or visible window state. */
343 int width
; /* window width in pixels */
344 int height
; /* window height in pixels */
345 int cursor
; /* cursor name */
346 int visState
; /* visibility state (-1 is unknown) */
347 int shownState
; /* if window mapped */
348 int entryState
; /* entry state (-1 is unknown) */
349 #define GLUT_MAX_MENUS 3
351 int menu
[GLUT_MAX_MENUS
]; /* attatched menu nums */
352 /* Window relationship state. */
353 GLUTwindow
*parent
; /* parent window */
354 GLUTwindow
*children
; /* list of children */
355 GLUTwindow
*siblings
; /* list of siblings */
356 /* Misc. non-API visible (hidden) state. */
357 Bool treatAsSingle
; /* treat this window as single-buffered
358 (it might be "fake" though) */
359 Bool forceReshape
; /* force reshape before display */
361 Bool isDirect
; /* if direct context (X11 only) */
363 Bool usedSwapBuffers
; /* if swap buffers used last display */
364 long eventMask
; /* mask of X events selected for */
365 int buttonUses
; /* number of button uses, ref cnt */
366 int tabletPos
[2]; /* tablet position (-1 is invalid) */
367 /* Work list related state. */
368 unsigned int workMask
; /* mask of window work to be done */
369 GLUTwindow
*prevWorkWin
; /* link list of windows to work on */
370 Bool desiredMapState
; /* how to mapped window if on map work
372 Bool ignoreKeyRepeat
; /* if window ignores autorepeat */
373 int desiredConfMask
; /* mask of desired window configuration
375 int desiredX
; /* desired X location */
376 int desiredY
; /* desired Y location */
377 int desiredWidth
; /* desired window width */
378 int desiredHeight
; /* desired window height */
379 int desiredStack
; /* desired window stack */
380 /* Per-window callbacks. */
381 GLUTdisplayCB display
; /* redraw */
382 GLUTreshapeCB reshape
; /* resize (width,height) */
383 GLUTmouseCB mouse
; /* mouse (button,state,x,y) */
384 GLUTmotionCB motion
; /* motion (x,y) */
385 GLUTpassiveCB passive
; /* passive motion (x,y) */
386 GLUTentryCB entry
; /* window entry/exit (state) */
387 GLUTkeyboardCB keyboard
; /* keyboard (ASCII,x,y) */
388 GLUTkeyboardCB keyboardUp
; /* keyboard up (ASCII,x,y) */
389 GLUTwindowStatusCB windowStatus
; /* window status */
390 GLUTvisibilityCB visibility
; /* visibility */
391 GLUTspecialCB special
; /* special key */
392 GLUTspecialCB specialUp
; /* special up key */
393 GLUTbuttonBoxCB buttonBox
; /* button box */
394 GLUTdialsCB dials
; /* dials */
395 GLUTspaceMotionCB spaceMotion
; /* Spaceball motion */
396 GLUTspaceRotateCB spaceRotate
; /* Spaceball rotate */
397 GLUTspaceButtonCB spaceButton
; /* Spaceball button */
398 GLUTtabletMotionCB tabletMotion
; /* tablet motion */
399 GLUTtabletButtonCB tabletButton
; /* tablet button */
401 GLUTjoystickCB joystick
; /* joystick */
402 int joyPollInterval
; /* joystick polling interval */
404 #ifdef SUPPORT_FORTRAN
405 GLUTdisplayFCB fdisplay
; /* Fortran display */
406 GLUTreshapeFCB freshape
; /* Fortran reshape */
407 GLUTmouseFCB fmouse
; /* Fortran mouse */
408 GLUTmotionFCB fmotion
; /* Fortran motion */
409 GLUTpassiveFCB fpassive
; /* Fortran passive */
410 GLUTentryFCB fentry
; /* Fortran entry */
411 GLUTkeyboardFCB fkeyboard
; /* Fortran keyboard */
412 GLUTkeyboardFCB fkeyboardUp
; /* Fortran keyboard up */
413 GLUTwindowStatusFCB fwindowStatus
; /* Fortran window status */
414 GLUTvisibilityFCB fvisibility
; /* Fortran visibility */
415 GLUTspecialFCB fspecial
; /* special key */
416 GLUTspecialFCB fspecialUp
; /* special key up */
417 GLUTbuttonBoxFCB fbuttonBox
; /* button box */
418 GLUTdialsFCB fdials
; /* dials */
419 GLUTspaceMotionFCB fspaceMotion
; /* Spaceball motion */
420 GLUTspaceRotateFCB fspaceRotate
; /* Spaceball rotate */
421 GLUTspaceButtonFCB fspaceButton
; /* Spaceball button */
422 GLUTtabletMotionFCB ftabletMotion
; /* tablet motion */
423 GLUTtabletButtonFCB ftabletButton
; /* tablet button */
425 GLUTjoystickFCB fjoystick
; /* joystick */
430 struct _GLUToverlay
{
437 XVisualInfo
*vis
; /* visual for window */
438 Bool visAlloced
; /* if vis needs deallocate on destroy */
439 Colormap cmap
; /* RGB colormap for window; None if CI */
440 GLUTcolormap
*colormap
; /* colormap; NULL if RGBA */
441 int shownState
; /* if overlay window mapped */
442 Bool treatAsSingle
; /* treat as single-buffered */
444 Bool isDirect
; /* if direct context */
446 int transparentPixel
; /* transparent pixel value */
447 GLUTdisplayCB display
; /* redraw */
448 #ifdef SUPPORT_FORTRAN
449 GLUTdisplayFCB fdisplay
; /* redraw */
453 typedef struct _GLUTstale GLUTstale
;
460 extern GLUTstale
*__glutStaleWindowList
;
462 #define GLUT_OVERLAY_EVENT_FILTER_MASK \
464 StructureNotifyMask | \
467 #define GLUT_DONT_PROPAGATE_FILTER_MASK \
468 (ButtonReleaseMask | \
472 PointerMotionMask | \
473 Button1MotionMask | \
474 Button2MotionMask | \
476 #define GLUT_HACK_STOP_PROPAGATE_MASK \
480 typedef struct _GLUTmenu GLUTmenu
;
481 typedef struct _GLUTmenuItem GLUTmenuItem
;
483 int id
; /* small integer menu id (0-based) */
484 Window win
; /* X window for the menu */
485 GLUTselectCB select
; /* function of menu */
486 GLUTmenuItem
*list
; /* list of menu entries */
487 int num
; /* number of entries */
489 Bool managed
; /* are the InputOnly windows size
491 Bool searched
; /* help detect menu loops */
492 int pixheight
; /* height of menu in pixels */
493 int pixwidth
; /* width of menu in pixels */
495 int submenus
; /* number of submenu entries */
496 GLUTmenuItem
*highlighted
; /* pointer to highlighted menu
497 entry, NULL not highlighted */
498 GLUTmenu
*cascade
; /* currently cascading this menu */
499 GLUTmenuItem
*anchor
; /* currently anchored to this entry */
500 int x
; /* current x origin relative to the
502 int y
; /* current y origin relative to the
504 #ifdef SUPPORT_FORTRAN
505 GLUTselectFCB fselect
; /* function of menu */
509 struct _GLUTmenuItem
{
510 Window win
; /* InputOnly X window for entry */
511 GLUTmenu
*menu
; /* menu entry belongs to */
512 Bool isTrigger
; /* is a submenu trigger? */
513 int value
; /* value to return for selecting this
514 entry; doubles as submenu id
515 (0-base) if submenu trigger */
517 UINT unique
; /* unique menu item id (Win32 only) */
519 char *label
; /* __glutStrdup'ed label string */
520 int len
; /* length of label string */
521 int pixwidth
; /* width of X window in pixels */
522 GLUTmenuItem
*next
; /* next menu entry on list for menu */
525 typedef struct _GLUTtimer GLUTtimer
;
527 GLUTtimer
*next
; /* list of timers */
528 struct timeval timeout
; /* time to be called */
529 GLUTtimerCB func
; /* timer (value) */
530 int value
; /* return value */
531 #ifdef SUPPORT_FORTRAN
532 GLUTtimerFCB ffunc
; /* Fortran timer */
536 typedef struct _GLUTeventParser GLUTeventParser
;
537 struct _GLUTeventParser
{
538 int (*func
) (XEvent
*);
539 GLUTeventParser
*next
;
542 /* Declarations to implement glutFullScreen support with
545 /* The following X property format is defined in Motif 1.1's
546 Xm/MwmUtils.h, but GLUT should not depend on that header
547 file. Note: Motif 1.2 expanded this structure with
548 uninteresting fields (to GLUT) so just stick with the
549 smaller Motif 1.1 structure. */
551 #define MWM_HINTS_DECORATIONS 2
558 /* Make current and buffer swap macros. */
560 #define MAKE_CURRENT_LAYER(window) \
562 HGLRC currentContext = GetCurrentContext(); \
563 HDC currentDc = GetCurrentDC(); \
565 if (currentContext != window->renderCtx \
566 || currentDc != window->renderDc) { \
567 MakeCurrent(window->renderDc, window->renderCtx); \
570 #define MAKE_CURRENT_WINDOW(window) \
572 HGLRC currentContext = GetCurrentContext(); \
573 HDC currentDc = GetCurrentDC(); \
575 if (currentContext != window->ctx || currentDc != window->hdc) { \
576 MakeCurrent(window->hdc, window->ctx); \
579 #define MAKE_CURRENT_OVERLAY(overlay) \
580 MakeCurrent(overlay->hdc, overlay->ctx)
581 #define UNMAKE_CURRENT() \
582 MakeCurrent(NULL, NULL)
583 #define SWAP_BUFFERS_WINDOW(window) \
584 SwapBuffers(window->hdc)
585 #define SWAP_BUFFERS_LAYER(window) \
586 SwapBuffers(window->renderDc)
588 #define MAKE_CURRENT_LAYER(window) \
589 glXMakeCurrent(__glutDisplay, window->renderWin, window->renderCtx)
590 #define MAKE_CURRENT_WINDOW(window) \
591 glXMakeCurrent(__glutDisplay, window->win, window->ctx)
592 #define MAKE_CURRENT_OVERLAY(overlay) \
593 glXMakeCurrent(__glutDisplay, overlay->win, overlay->ctx)
594 #define UNMAKE_CURRENT() \
595 glXMakeCurrent(__glutDisplay, None, NULL)
596 #define SWAP_BUFFERS_WINDOW(window) \
597 glXSwapBuffers(__glutDisplay, window->win)
598 #define SWAP_BUFFERS_LAYER(window) \
599 glXSwapBuffers(__glutDisplay, window->renderWin)
602 /* private variables from glut_event.c */
603 extern GLUTwindow
*__glutWindowWorkList
;
604 extern int __glutWindowDamaged
;
605 #ifdef SUPPORT_FORTRAN
606 extern GLUTtimer
*__glutTimerList
;
607 extern GLUTtimer
*__glutNewTimer
;
609 extern GLUTmenu
*__glutMappedMenu
;
611 extern void (*__glutUpdateInputDeviceMaskFunc
) (GLUTwindow
*);
613 extern void (*__glutMenuItemEnterOrLeave
)(GLUTmenuItem
* item
,
615 extern void (*__glutFinishMenu
)(Window win
, int x
, int y
);
616 extern void (*__glutPaintMenu
)(GLUTmenu
* menu
);
617 extern void (*__glutStartMenu
)(GLUTmenu
* menu
,
618 GLUTwindow
* window
, int x
, int y
, int x_win
, int y_win
);
619 extern GLUTmenu
* (*__glutGetMenuByNum
)(int menunum
);
620 extern GLUTmenuItem
* (*__glutGetMenuItem
)(GLUTmenu
* menu
,
621 Window win
, int *which
);
622 extern GLUTmenu
* (*__glutGetMenu
)(Window win
);
625 /* private variables from glut_init.c */
626 extern Atom __glutWMDeleteWindow
;
627 extern Display
*__glutDisplay
;
628 extern unsigned int __glutDisplayMode
;
629 extern char *__glutDisplayString
;
630 extern XVisualInfo
*(*__glutDetermineVisualFromString
) (char *string
, Bool
* treatAsSingle
,
631 Criterion
* requiredCriteria
, int nRequired
, int requiredMask
, void **fbc
);
632 extern GLboolean __glutDebug
;
633 extern GLboolean __glutForceDirect
;
634 extern GLboolean __glutIconic
;
635 extern GLboolean __glutTryDirect
;
636 extern Window __glutRoot
;
637 extern XSizeHints __glutSizeHints
;
638 extern char **__glutArgv
;
639 extern char *__glutProgramName
;
640 extern int __glutArgc
;
641 extern int __glutConnectionFD
;
642 extern int __glutInitHeight
;
643 extern int __glutInitWidth
;
644 extern int __glutInitX
;
645 extern int __glutInitY
;
646 extern int __glutScreen
;
647 extern int __glutScreenHeight
;
648 extern int __glutScreenWidth
;
649 extern Atom __glutMotifHints
;
650 extern unsigned int __glutModifierMask
;
652 extern void (__cdecl
*__glutExitFunc
)(int retval
);
655 /* private variables from glut_menu.c */
656 extern GLUTmenuItem
*__glutItemSelected
;
657 extern GLUTmenu
**__glutMenuList
;
658 extern void (GLUTCALLBACK
*__glutMenuStatusFunc
) (int, int, int);
659 extern void __glutMenuModificationError(void);
660 extern void __glutSetMenuItem(GLUTmenuItem
* item
,
661 const char *label
, int value
, Bool isTrigger
);
663 /* private variables from glut_win.c */
664 extern GLUTwindow
**__glutWindowList
;
665 extern GLUTwindow
*__glutCurrentWindow
;
666 extern GLUTwindow
*__glutMenuWindow
;
667 extern GLUTmenu
*__glutCurrentMenu
;
668 extern int __glutWindowListSize
;
669 extern void (*__glutFreeOverlayFunc
) (GLUToverlay
*);
670 extern XVisualInfo
*__glutDetermineWindowVisual(Bool
* treatAsSingle
,
671 Bool
* visAlloced
, void **fbc
);
673 /* private variables from glut_mesa.c */
674 extern int __glutMesaSwapHackSupport
;
676 /* private variables from glut_gamemode.c */
677 extern GLUTwindow
*__glutGameModeWindow
;
679 /* private routines from glut_cindex.c */
680 extern GLUTcolormap
* __glutAssociateNewColormap(XVisualInfo
* vis
);
681 extern void __glutFreeColormap(GLUTcolormap
*);
683 /* private routines from glut_cmap.c */
684 extern void __glutSetupColormap(
686 GLUTcolormap
** colormap
,
689 extern void __glutEstablishColormapsProperty(
690 GLUTwindow
* window
);
691 extern GLUTwindow
*__glutToplevelOf(GLUTwindow
* window
);
694 /* private routines from glut_cursor.c */
695 extern void __glutSetCursor(GLUTwindow
*window
);
697 /* private routines from glut_event.c */
698 extern void __glutPutOnWorkList(GLUTwindow
* window
,
700 extern void __glutRegisterEventParser(GLUTeventParser
* parser
);
701 extern void __glutPostRedisplay(GLUTwindow
* window
, int layerMask
);
703 /* private routines from glut_init.c */
705 extern void __glutOpenXConnection(char *display
);
707 extern void __glutOpenWin32Connection(char *display
);
709 extern void __glutInitTime(struct timeval
*beginning
);
711 /* private routines for glut_menu.c (or win32_menu.c) */
713 extern GLUTmenu
*__glutGetMenu(Window win
);
714 extern GLUTmenu
*__glutGetMenuByNum(int menunum
);
715 extern GLUTmenuItem
*__glutGetMenuItem(GLUTmenu
* menu
,
716 Window win
, int *which
);
717 extern void __glutStartMenu(GLUTmenu
* menu
,
718 GLUTwindow
* window
, int x
, int y
, int x_win
, int y_win
);
719 extern void __glutFinishMenu(Window win
, int x
, int y
);
721 extern void __glutSetMenu(GLUTmenu
* menu
);
723 /* private routines from glut_util.c */
724 extern char * __glutStrdup(const char *string
);
725 extern void __glutWarning(char *format
,...);
726 extern void __glutFatalError(char *format
,...);
727 extern void __glutFatalUsage(char *format
,...);
729 /* private routines from glut_win.c */
730 extern GLUTwindow
*__glutGetWindow(Window win
);
731 extern void __glutChangeWindowEventMask(long mask
, Bool add
);
732 extern XVisualInfo
*__glutDetermineVisual(
735 XVisualInfo
* (getVisualInfo
) (unsigned int));
736 extern XVisualInfo
*__glutGetVisualInfo(unsigned int mode
);
737 extern void __glutSetWindow(GLUTwindow
* window
);
738 extern void __glutReshapeFunc(GLUTreshapeCB reshapeFunc
,
739 int callingConvention
);
740 extern void GLUTCALLBACK
__glutDefaultReshape(int, int);
741 extern GLUTwindow
*__glutCreateWindow(
743 int x
, int y
, int width
, int height
, int gamemode
);
744 extern void __glutDestroyWindow(
746 GLUTwindow
* initialWindow
);
749 /* private routines from glut_glxext.c */
750 extern int __glutIsSupportedByGLX(char *);
753 /* private routines from glut_input.c */
754 extern void __glutUpdateInputDeviceMask(GLUTwindow
* window
);
756 /* private routines from glut_mesa.c */
757 extern void __glutDetermineMesaSwapHackSupport(void);
759 /* private routines from glut_gameglut.c */
760 extern void GLUTAPIENTRYV
__glutCloseDownGameMode(void);
763 /* private routines from win32_*.c */
764 extern LONG WINAPI
__glutWindowProc(HWND win
, UINT msg
, WPARAM w
, LPARAM l
);
768 #endif /* __glutint_h__ */