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. */
11 #include <GL/vms_x_fix.h>
14 #if defined(__CYGWIN32__)
18 #define SUPPORT_FORTRAN /* With GLUT 3.7, everyone supports Fortran. */
21 #include "glutwin32.h"
24 #include <X11/Xutil.h>
25 #define GLX_GLXEXT_PROTOTYPES
29 #ifndef GLUT_BUILDING_LIB
30 #define GLUT_BUILDING_LIB /* Building the GLUT library itself. */
35 #if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
36 #include <GL/mesa_wgl.h>
40 /* added by BrianP: */
42 #define APIENTRY GLAPIENTRY
44 #define __cdecl GLAPIENTRY
45 #define CDECL GLAPIENTRY
48 /* GLUT_BUILDING_LIB is used by <GL/glut.h> to 1) not #pragma link
49 with the GLUT library, and 2) avoid the Win32 atexit hack. */
51 /* This must be done after <GL/gl.h> is included. MESA is defined
52 if the <GL/gl.h> is supplied by Brian Paul's Mesa library. */
53 #if defined(MESA) && defined(_WIN32)
54 /* Mesa implements "wgl" versions of GDI entry points needed for
55 using OpenGL. Map these "wgl" versions to the GDI names via
57 #define ChoosePixelFormat wglChoosePixelFormat
58 #define DescribePixelFormat wglDescribePixelFormat
59 #define GetPixelFormat wglGetPixelFormat
60 #define SetPixelFormat wglSetPixelFormat
61 #define SwapBuffers wglSwapBuffers
62 #define GetCurrentContext wglGetCurrentContext
63 #define GetCurrentDC wglGetCurrentDC
64 #define MakeCurrent wglMakeCurrent
65 #define CreateContext wglCreateContext
66 #define DeleteContext wglDeleteContext
69 #ifdef SUPPORT_FORTRAN
70 #include <GL/glutf90.h>
74 #if ( __VMS_VER < 70000000 )
79 extern int sys$
gettim(struct timeval6
*);
84 #include <sys/types.h>
85 #if !defined(_WIN32) || defined(__CYGWIN32__)
91 #if defined(__vms) && ( __VMS_VER < 70000000 )
93 /* For VMS6.2 or lower :
94 One TICK on VMS is 100 nanoseconds; 0.1 microseconds or
95 0.0001 milliseconds. This means that there are 0.01
96 ticks/ns, 10 ticks/us, 10,000 ticks/ms and 10,000,000
99 #define TICKS_PER_MILLISECOND 10000
100 #define TICKS_PER_SECOND 10000000
102 #define GETTIMEOFDAY(_x) (void) sys$gettim (_x);
104 #define ADD_TIME(dest, src1, src2) { \
105 (dest).val = (src1).val + (src2).val; \
108 #define TIMEDELTA(dest, src1, src2) { \
109 (dest).val = (src1).val - (src2).val; \
112 #define IS_AFTER(t1, t2) ((t2).val > (t1).val)
114 #define IS_AT_OR_AFTER(t1, t2) ((t2).val >= (t1).val)
117 #if defined(SVR4) && !defined(sun) /* Sun claims SVR4, but
119 #define GETTIMEOFDAY(_x) gettimeofday(_x)
121 #define GETTIMEOFDAY(_x) gettimeofday(_x, NULL)
123 #define ADD_TIME(dest, src1, src2) { \
124 if(((dest).tv_usec = \
125 (src1).tv_usec + (src2).tv_usec) >= 1000000) { \
126 (dest).tv_usec -= 1000000; \
127 (dest).tv_sec = (src1).tv_sec + (src2).tv_sec + 1; \
129 (dest).tv_sec = (src1).tv_sec + (src2).tv_sec; \
130 if(((dest).tv_sec >= 1) && (((dest).tv_usec <0))) { \
131 (dest).tv_sec --;(dest).tv_usec += 1000000; \
135 #define TIMEDELTA(dest, src1, src2) { \
136 if(((dest).tv_usec = (src1).tv_usec - (src2).tv_usec) < 0) { \
137 (dest).tv_usec += 1000000; \
138 (dest).tv_sec = (src1).tv_sec - (src2).tv_sec - 1; \
140 (dest).tv_sec = (src1).tv_sec - (src2).tv_sec; \
143 #define IS_AFTER(t1, t2) \
144 (((t2).tv_sec > (t1).tv_sec) || \
145 (((t2).tv_sec == (t1).tv_sec) && \
146 ((t2).tv_usec > (t1).tv_usec)))
147 #define IS_AT_OR_AFTER(t1, t2) \
148 (((t2).tv_sec > (t1).tv_sec) || \
149 (((t2).tv_sec == (t1).tv_sec) && \
150 ((t2).tv_usec >= (t1).tv_usec)))
153 #define IGNORE_IN_GAME_MODE() \
154 { if (__glutGameModeWindow) return; }
156 #define GLUT_WIND_IS_RGB(x) (((x) & GLUT_INDEX) == 0)
157 #define GLUT_WIND_IS_INDEX(x) (((x) & GLUT_INDEX) != 0)
158 #define GLUT_WIND_IS_SINGLE(x) (((x) & GLUT_DOUBLE) == 0)
159 #define GLUT_WIND_IS_DOUBLE(x) (((x) & GLUT_DOUBLE) != 0)
160 #define GLUT_WIND_HAS_ACCUM(x) (((x) & GLUT_ACCUM) != 0)
161 #define GLUT_WIND_HAS_ALPHA(x) (((x) & GLUT_ALPHA) != 0)
162 #define GLUT_WIND_HAS_DEPTH(x) (((x) & GLUT_DEPTH) != 0)
163 #define GLUT_WIND_HAS_STENCIL(x) (((x) & GLUT_STENCIL) != 0)
164 #define GLUT_WIND_IS_MULTISAMPLE(x) (((x) & GLUT_MULTISAMPLE) != 0)
165 #define GLUT_WIND_IS_STEREO(x) (((x) & GLUT_STEREO) != 0)
166 #define GLUT_WIND_IS_LUMINANCE(x) (((x) & GLUT_LUMINANCE) != 0)
167 #define GLUT_MAP_WORK (1 << 0)
168 #define GLUT_EVENT_MASK_WORK (1 << 1)
169 #define GLUT_REDISPLAY_WORK (1 << 2)
170 #define GLUT_CONFIGURE_WORK (1 << 3)
171 #define GLUT_COLORMAP_WORK (1 << 4)
172 #define GLUT_DEVICE_MASK_WORK (1 << 5)
173 #define GLUT_FINISH_WORK (1 << 6)
174 #define GLUT_DEBUG_WORK (1 << 7)
175 #define GLUT_DUMMY_WORK (1 << 8)
176 #define GLUT_FULL_SCREEN_WORK (1 << 9)
177 #define GLUT_OVERLAY_REDISPLAY_WORK (1 << 10)
178 #define GLUT_REPAIR_WORK (1 << 11)
179 #define GLUT_OVERLAY_REPAIR_WORK (1 << 12)
181 /* Frame buffer capability macros and types. */
183 #define BUFFER_SIZE 1
184 #define DOUBLEBUFFER 2
186 #define AUX_BUFFERS 4
187 #define RED_SIZE 5 /* Used as mask bit for
193 #define STENCIL_SIZE 10
194 #define ACCUM_RED_SIZE 11 /* Used as mask bit for
196 #define ACCUM_GREEN_SIZE 12
197 #define ACCUM_BLUE_SIZE 13
198 #define ACCUM_ALPHA_SIZE 14
201 #define NUM_GLXCAPS (LEVEL + 1)
203 #define XVISUAL (NUM_GLXCAPS + 0)
204 #define TRANSPARENT (NUM_GLXCAPS + 1)
205 #define SAMPLES (NUM_GLXCAPS + 2)
206 #define XSTATICGRAY (NUM_GLXCAPS + 3) /* Used as
211 #define XGRAYSCALE (NUM_GLXCAPS + 4)
212 #define XSTATICCOLOR (NUM_GLXCAPS + 5)
213 #define XPSEUDOCOLOR (NUM_GLXCAPS + 6)
214 #define XTRUECOLOR (NUM_GLXCAPS + 7)
215 #define XDIRECTCOLOR (NUM_GLXCAPS + 8)
216 #define SLOW (NUM_GLXCAPS + 9)
217 #define CONFORMANT (NUM_GLXCAPS + 10)
219 #define NUM_CAPS (NUM_GLXCAPS + 11)
221 /* Frame buffer capablities that don't have a corresponding
222 FrameBufferMode entry. These get used as mask bits. */
223 #define NUM (NUM_CAPS + 0)
224 #define RGBA_MODE (NUM_CAPS + 1)
225 #define CI_MODE (NUM_CAPS + 2)
226 #define LUMINANCE_MODE (NUM_CAPS + 3)
237 typedef struct _Criterion
{
243 typedef struct _FrameBufferMode
{
245 #if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
247 /* fbc is non-NULL when the XVisualInfo* is not OpenGL-capable
248 (ie, GLX_USE_GL is false), but the SGIX_fbconfig extension shows
249 the visual's fbconfig is OpenGL-capable. The reason for this is typically
250 an RGBA luminance fbconfig such as 16-bit StaticGray that could
251 not be advertised as a GLX visual since StaticGray visuals are
252 required (by the GLX specification) to be color index. The
253 SGIX_fbconfig allows StaticGray visuals to instead advertised as
254 fbconfigs that can provide RGBA luminance support. */
262 /* DisplayMode capability macros for game mode. */
263 #define DM_WIDTH 0 /* "width" */
264 #define DM_HEIGHT 1 /* "height" */
265 #define DM_PIXEL_DEPTH 2 /* "bpp" (bits per pixel) */
266 #define DM_HERTZ 3 /* "hertz" */
267 #define DM_NUM 4 /* "num" */
269 #define NUM_DM_CAPS (DM_NUM+1)
271 typedef struct _DisplayMode
{
275 /* XXX The X Window System does not have a standard
276 mechanism for display setting changes. On SGI
277 systems, GLUT could use the XSGIvc (SGI X video
278 control extension). Perhaps this can be done in
279 a future release of GLUT. */
282 int cap
[NUM_DM_CAPS
];
285 /* GLUT function types */
286 typedef void (GLUTCALLBACK
*GLUTdisplayCB
) (void);
287 typedef void (GLUTCALLBACK
*GLUTreshapeCB
) (int, int);
288 typedef void (GLUTCALLBACK
*GLUTkeyboardCB
) (unsigned char, int, int);
289 typedef void (GLUTCALLBACK
*GLUTmouseCB
) (int, int, int, int);
290 typedef void (GLUTCALLBACK
*GLUTmotionCB
) (int, int);
291 typedef void (GLUTCALLBACK
*GLUTpassiveCB
) (int, int);
292 typedef void (GLUTCALLBACK
*GLUTentryCB
) (int);
293 typedef void (GLUTCALLBACK
*GLUTvisibilityCB
) (int);
294 typedef void (GLUTCALLBACK
*GLUTwindowStatusCB
) (int);
295 typedef void (GLUTCALLBACK
*GLUTidleCB
) (void);
296 typedef void (GLUTCALLBACK
*GLUTtimerCB
) (int);
297 typedef void (GLUTCALLBACK
*GLUTmenuStateCB
) (int); /* DEPRICATED. */
298 typedef void (GLUTCALLBACK
*GLUTmenuStatusCB
) (int, int, int);
299 typedef void (GLUTCALLBACK
*GLUTselectCB
) (int);
300 typedef void (GLUTCALLBACK
*GLUTspecialCB
) (int, int, int);
301 typedef void (GLUTCALLBACK
*GLUTspaceMotionCB
) (int, int, int);
302 typedef void (GLUTCALLBACK
*GLUTspaceRotateCB
) (int, int, int);
303 typedef void (GLUTCALLBACK
*GLUTspaceButtonCB
) (int, int);
304 typedef void (GLUTCALLBACK
*GLUTdialsCB
) (int, int);
305 typedef void (GLUTCALLBACK
*GLUTbuttonBoxCB
) (int, int);
306 typedef void (GLUTCALLBACK
*GLUTtabletMotionCB
) (int, int);
307 typedef void (GLUTCALLBACK
*GLUTtabletButtonCB
) (int, int, int, int);
308 typedef void (GLUTCALLBACK
*GLUTjoystickCB
) (unsigned int buttonMask
, int x
, int y
, int z
);
310 typedef struct _GLUTcolorcell GLUTcolorcell
;
311 struct _GLUTcolorcell
{
312 /* GLUT_RED, GLUT_GREEN, GLUT_BLUE */
313 GLfloat component
[3];
316 typedef struct _GLUTcolormap GLUTcolormap
;
317 struct _GLUTcolormap
{
318 Visual
*visual
; /* visual of the colormap */
319 Colormap cmap
; /* X colormap ID */
320 int refcnt
; /* number of windows using colormap */
321 int size
; /* number of cells in colormap */
322 int transparent
; /* transparent pixel, or -1 if opaque */
323 GLUTcolorcell
*cells
; /* array of cells */
324 GLUTcolormap
*next
; /* next colormap in list */
327 typedef struct _GLUTwindow GLUTwindow
;
328 typedef struct _GLUToverlay GLUToverlay
;
330 int num
; /* Small integer window id (0-based). */
332 /* Window system related state. */
334 int pf
; /* Pixel format. */
335 HDC hdc
; /* Window's Win32 device context. */
337 Window win
; /* X window for GLUT window */
338 GLXContext ctx
; /* OpenGL context GLUT glut window */
339 XVisualInfo
*vis
; /* visual for window */
340 Bool visAlloced
; /* if vis needs deallocate on destroy */
341 Colormap cmap
; /* RGB colormap for window; None if CI */
342 GLUTcolormap
*colormap
; /* colormap; NULL if RGBA */
343 GLUToverlay
*overlay
; /* overlay; NULL if no overlay */
345 HDC renderDc
; /* Win32's device context for rendering. */
347 Window renderWin
; /* X window for rendering (might be
349 GLXContext renderCtx
; /* OpenGL context for rendering (might
351 /* GLUT settable or visible window state. */
352 int width
; /* window width in pixels */
353 int height
; /* window height in pixels */
354 int cursor
; /* cursor name */
355 int visState
; /* visibility state (-1 is unknown) */
356 int shownState
; /* if window mapped */
357 int entryState
; /* entry state (-1 is unknown) */
358 #define GLUT_MAX_MENUS 3
360 int menu
[GLUT_MAX_MENUS
]; /* attatched menu nums */
361 /* Window relationship state. */
362 GLUTwindow
*parent
; /* parent window */
363 GLUTwindow
*children
; /* list of children */
364 GLUTwindow
*siblings
; /* list of siblings */
365 /* Misc. non-API visible (hidden) state. */
366 Bool treatAsSingle
; /* treat this window as single-buffered
367 (it might be "fake" though) */
368 Bool forceReshape
; /* force reshape before display */
370 Bool isDirect
; /* if direct context (X11 only) */
372 Bool usedSwapBuffers
; /* if swap buffers used last display */
373 long eventMask
; /* mask of X events selected for */
374 int buttonUses
; /* number of button uses, ref cnt */
375 int tabletPos
[2]; /* tablet position (-1 is invalid) */
376 /* Work list related state. */
377 unsigned int workMask
; /* mask of window work to be done */
378 GLUTwindow
*prevWorkWin
; /* link list of windows to work on */
379 Bool desiredMapState
; /* how to mapped window if on map work
381 Bool ignoreKeyRepeat
; /* if window ignores autorepeat */
382 int desiredConfMask
; /* mask of desired window configuration
384 int desiredX
; /* desired X location */
385 int desiredY
; /* desired Y location */
386 int desiredWidth
; /* desired window width */
387 int desiredHeight
; /* desired window height */
388 int desiredStack
; /* desired window stack */
389 /* Per-window callbacks. */
390 GLUTdisplayCB display
; /* redraw */
391 GLUTreshapeCB reshape
; /* resize (width,height) */
392 GLUTmouseCB mouse
; /* mouse (button,state,x,y) */
393 GLUTmotionCB motion
; /* motion (x,y) */
394 GLUTpassiveCB passive
; /* passive motion (x,y) */
395 GLUTentryCB entry
; /* window entry/exit (state) */
396 GLUTkeyboardCB keyboard
; /* keyboard (ASCII,x,y) */
397 GLUTkeyboardCB keyboardUp
; /* keyboard up (ASCII,x,y) */
398 GLUTwindowStatusCB windowStatus
; /* window status */
399 GLUTvisibilityCB visibility
; /* visibility */
400 GLUTspecialCB special
; /* special key */
401 GLUTspecialCB specialUp
; /* special up key */
402 GLUTbuttonBoxCB buttonBox
; /* button box */
403 GLUTdialsCB dials
; /* dials */
404 GLUTspaceMotionCB spaceMotion
; /* Spaceball motion */
405 GLUTspaceRotateCB spaceRotate
; /* Spaceball rotate */
406 GLUTspaceButtonCB spaceButton
; /* Spaceball button */
407 GLUTtabletMotionCB tabletMotion
; /* tablet motion */
408 GLUTtabletButtonCB tabletButton
; /* tablet button */
410 GLUTjoystickCB joystick
; /* joystick */
411 int joyPollInterval
; /* joystick polling interval */
413 #ifdef SUPPORT_FORTRAN
414 GLUTdisplayFCB fdisplay
; /* Fortran display */
415 GLUTreshapeFCB freshape
; /* Fortran reshape */
416 GLUTmouseFCB fmouse
; /* Fortran mouse */
417 GLUTmotionFCB fmotion
; /* Fortran motion */
418 GLUTpassiveFCB fpassive
; /* Fortran passive */
419 GLUTentryFCB fentry
; /* Fortran entry */
420 GLUTkeyboardFCB fkeyboard
; /* Fortran keyboard */
421 GLUTkeyboardFCB fkeyboardUp
; /* Fortran keyboard up */
422 GLUTwindowStatusFCB fwindowStatus
; /* Fortran window status */
423 GLUTvisibilityFCB fvisibility
; /* Fortran visibility */
424 GLUTspecialFCB fspecial
; /* special key */
425 GLUTspecialFCB fspecialUp
; /* special key up */
426 GLUTbuttonBoxFCB fbuttonBox
; /* button box */
427 GLUTdialsFCB fdials
; /* dials */
428 GLUTspaceMotionFCB fspaceMotion
; /* Spaceball motion */
429 GLUTspaceRotateFCB fspaceRotate
; /* Spaceball rotate */
430 GLUTspaceButtonFCB fspaceButton
; /* Spaceball button */
431 GLUTtabletMotionFCB ftabletMotion
; /* tablet motion */
432 GLUTtabletButtonFCB ftabletButton
; /* tablet button */
434 GLUTjoystickFCB fjoystick
; /* joystick */
439 struct _GLUToverlay
{
446 XVisualInfo
*vis
; /* visual for window */
447 Bool visAlloced
; /* if vis needs deallocate on destroy */
448 Colormap cmap
; /* RGB colormap for window; None if CI */
449 GLUTcolormap
*colormap
; /* colormap; NULL if RGBA */
450 int shownState
; /* if overlay window mapped */
451 Bool treatAsSingle
; /* treat as single-buffered */
453 Bool isDirect
; /* if direct context */
455 int transparentPixel
; /* transparent pixel value */
456 GLUTdisplayCB display
; /* redraw */
457 #ifdef SUPPORT_FORTRAN
458 GLUTdisplayFCB fdisplay
; /* redraw */
462 typedef struct _GLUTstale GLUTstale
;
469 extern GLUTstale
*__glutStaleWindowList
;
471 #define GLUT_OVERLAY_EVENT_FILTER_MASK \
473 StructureNotifyMask | \
476 #define GLUT_DONT_PROPAGATE_FILTER_MASK \
477 (ButtonReleaseMask | \
481 PointerMotionMask | \
482 Button1MotionMask | \
483 Button2MotionMask | \
485 #define GLUT_HACK_STOP_PROPAGATE_MASK \
489 typedef struct _GLUTmenu GLUTmenu
;
490 typedef struct _GLUTmenuItem GLUTmenuItem
;
492 int id
; /* small integer menu id (0-based) */
493 Window win
; /* X window for the menu */
494 GLUTselectCB select
; /* function of menu */
495 GLUTmenuItem
*list
; /* list of menu entries */
496 int num
; /* number of entries */
498 Bool managed
; /* are the InputOnly windows size
500 Bool searched
; /* help detect menu loops */
501 int pixheight
; /* height of menu in pixels */
502 int pixwidth
; /* width of menu in pixels */
504 int submenus
; /* number of submenu entries */
505 GLUTmenuItem
*highlighted
; /* pointer to highlighted menu
506 entry, NULL not highlighted */
507 GLUTmenu
*cascade
; /* currently cascading this menu */
508 GLUTmenuItem
*anchor
; /* currently anchored to this entry */
509 int x
; /* current x origin relative to the
511 int y
; /* current y origin relative to the
513 #ifdef SUPPORT_FORTRAN
514 GLUTselectFCB fselect
; /* function of menu */
518 struct _GLUTmenuItem
{
519 Window win
; /* InputOnly X window for entry */
520 GLUTmenu
*menu
; /* menu entry belongs to */
521 Bool isTrigger
; /* is a submenu trigger? */
522 int value
; /* value to return for selecting this
523 entry; doubles as submenu id
524 (0-base) if submenu trigger */
526 UINT unique
; /* unique menu item id (Win32 only) */
528 char *label
; /* __glutStrdup'ed label string */
529 int len
; /* length of label string */
530 int pixwidth
; /* width of X window in pixels */
531 GLUTmenuItem
*next
; /* next menu entry on list for menu */
534 typedef struct _GLUTtimer GLUTtimer
;
536 GLUTtimer
*next
; /* list of timers */
538 struct timeval6 timeout
; /* time to be called */
540 struct timeval timeout
; /* time to be called */
542 GLUTtimerCB func
; /* timer (value) */
543 int value
; /* return value */
544 #ifdef SUPPORT_FORTRAN
545 GLUTtimerFCB ffunc
; /* Fortran timer */
549 typedef struct _GLUTeventParser GLUTeventParser
;
550 struct _GLUTeventParser
{
551 int (*func
) (XEvent
*);
552 GLUTeventParser
*next
;
555 /* Declarations to implement glutFullScreen support with
558 /* The following X property format is defined in Motif 1.1's
559 Xm/MwmUtils.h, but GLUT should not depend on that header
560 file. Note: Motif 1.2 expanded this structure with
561 uninteresting fields (to GLUT) so just stick with the
562 smaller Motif 1.1 structure. */
564 #define MWM_HINTS_DECORATIONS 2
571 /* Make current and buffer swap macros. */
573 #define MAKE_CURRENT_LAYER(window) \
575 HGLRC currentContext = GetCurrentContext(); \
576 HDC currentDc = GetCurrentDC(); \
578 if (currentContext != window->renderCtx \
579 || currentDc != window->renderDc) { \
580 MakeCurrent(window->renderDc, window->renderCtx); \
583 #define MAKE_CURRENT_WINDOW(window) \
585 HGLRC currentContext = GetCurrentContext(); \
586 HDC currentDc = GetCurrentDC(); \
588 if (currentContext != window->ctx || currentDc != window->hdc) { \
589 MakeCurrent(window->hdc, window->ctx); \
592 #define MAKE_CURRENT_OVERLAY(overlay) \
593 MakeCurrent(overlay->hdc, overlay->ctx)
594 #define UNMAKE_CURRENT() \
595 MakeCurrent(NULL, NULL)
596 #define SWAP_BUFFERS_WINDOW(window) \
597 SwapBuffers(window->hdc)
598 #define SWAP_BUFFERS_LAYER(window) \
599 SwapBuffers(window->renderDc)
601 #define MAKE_CURRENT_LAYER(window) \
602 glXMakeCurrent(__glutDisplay, window->renderWin, window->renderCtx)
603 #define MAKE_CURRENT_WINDOW(window) \
604 glXMakeCurrent(__glutDisplay, window->win, window->ctx)
605 #define MAKE_CURRENT_OVERLAY(overlay) \
606 glXMakeCurrent(__glutDisplay, overlay->win, overlay->ctx)
607 #define UNMAKE_CURRENT() \
608 glXMakeCurrent(__glutDisplay, None, NULL)
609 #define SWAP_BUFFERS_WINDOW(window) \
610 glXSwapBuffers(__glutDisplay, window->win)
611 #define SWAP_BUFFERS_LAYER(window) \
612 glXSwapBuffers(__glutDisplay, window->renderWin)
615 /* private variables from glut_event.c */
616 extern GLUTwindow
*__glutWindowWorkList
;
617 extern int __glutWindowDamaged
;
618 #ifdef SUPPORT_FORTRAN
619 extern GLUTtimer
*__glutTimerList
;
620 extern GLUTtimer
*__glutNewTimer
;
622 extern GLUTmenu
*__glutMappedMenu
;
624 extern void (*__glutUpdateInputDeviceMaskFunc
) (GLUTwindow
*);
626 extern void (*__glutMenuItemEnterOrLeave
)(GLUTmenuItem
* item
,
628 extern void (*__glutFinishMenu
)(Window win
, int x
, int y
);
629 extern void (*__glutPaintMenu
)(GLUTmenu
* menu
);
630 extern void (*__glutStartMenu
)(GLUTmenu
* menu
,
631 GLUTwindow
* window
, int x
, int y
, int x_win
, int y_win
);
632 extern GLUTmenu
* (*__glutGetMenuByNum
)(int menunum
);
633 extern GLUTmenuItem
* (*__glutGetMenuItem
)(GLUTmenu
* menu
,
634 Window win
, int *which
);
635 extern GLUTmenu
* (*__glutGetMenu
)(Window win
);
638 /* private variables from glut_init.c */
639 extern Atom __glutWMDeleteWindow
;
640 extern Display
*__glutDisplay
;
641 extern unsigned int __glutDisplayMode
;
642 extern char *__glutDisplayString
;
643 extern XVisualInfo
*(*__glutDetermineVisualFromString
) (char *string
, Bool
* treatAsSingle
,
644 Criterion
* requiredCriteria
, int nRequired
, int requiredMask
, void **fbc
);
645 extern GLboolean __glutDebug
;
646 extern GLboolean __glutForceDirect
;
647 extern GLboolean __glutIconic
;
648 extern GLboolean __glutTryDirect
;
649 extern Window __glutRoot
;
650 extern XSizeHints __glutSizeHints
;
651 extern char **__glutArgv
;
652 extern char *__glutProgramName
;
653 extern int __glutArgc
;
654 extern int __glutConnectionFD
;
655 extern int __glutInitHeight
;
656 extern int __glutInitWidth
;
657 extern int __glutInitX
;
658 extern int __glutInitY
;
659 extern int __glutScreen
;
660 extern int __glutScreenHeight
;
661 extern int __glutScreenWidth
;
662 extern Atom __glutMotifHints
;
663 extern unsigned int __glutModifierMask
;
665 extern void (__cdecl
*__glutExitFunc
)(int retval
);
668 /* private variables from glut_menu.c */
669 extern GLUTmenuItem
*__glutItemSelected
;
670 extern GLUTmenu
**__glutMenuList
;
671 extern void (GLUTCALLBACK
*__glutMenuStatusFunc
) (int, int, int);
672 extern void __glutMenuModificationError(void);
673 extern void __glutSetMenuItem(GLUTmenuItem
* item
,
674 const char *label
, int value
, Bool isTrigger
);
676 /* private variables from glut_win.c */
677 extern GLUTwindow
**__glutWindowList
;
678 extern GLUTwindow
*__glutCurrentWindow
;
679 extern GLUTwindow
*__glutMenuWindow
;
680 extern GLUTmenu
*__glutCurrentMenu
;
681 extern int __glutWindowListSize
;
682 extern void (*__glutFreeOverlayFunc
) (GLUToverlay
*);
683 extern void __glutFreeOverlay(GLUToverlay
* overlay
);
684 extern XVisualInfo
*__glutDetermineWindowVisual(Bool
* treatAsSingle
,
685 Bool
* visAlloced
, void **fbc
);
687 /* private variables from glut_mesa.c */
688 extern int __glutMesaSwapHackSupport
;
690 /* private variables from glut_gamemode.c */
691 extern GLUTwindow
*__glutGameModeWindow
;
693 /* private routines from glut_cindex.c */
694 extern GLUTcolormap
* __glutAssociateNewColormap(XVisualInfo
* vis
);
695 extern void __glutFreeColormap(GLUTcolormap
*);
697 /* private routines from glut_cmap.c */
698 extern void __glutSetupColormap(
700 GLUTcolormap
** colormap
,
703 extern void __glutEstablishColormapsProperty(
704 GLUTwindow
* window
);
705 extern GLUTwindow
*__glutToplevelOf(GLUTwindow
* window
);
708 /* private routines from glut_cursor.c */
709 extern void __glutSetCursor(GLUTwindow
*window
);
711 /* private routines from glut_event.c */
712 extern void __glutPutOnWorkList(GLUTwindow
* window
,
714 extern void __glutRegisterEventParser(GLUTeventParser
* parser
);
715 extern void __glutPostRedisplay(GLUTwindow
* window
, int layerMask
);
716 extern void handleTimeouts(void);
718 /* private routines from glut_init.c */
720 extern void __glutOpenXConnection(char *display
);
722 extern void __glutOpenWin32Connection(char *display
);
725 extern void __glutInitTime(struct timeval6
*beginning
);
727 extern void __glutInitTime(struct timeval
*beginning
);
730 /* private routines for glut_menu.c (or win32_menu.c) */
732 extern GLUTmenu
*__glutGetMenu(Window win
);
733 extern GLUTmenu
*__glutGetMenuByNum(int menunum
);
734 extern GLUTmenuItem
*__glutGetMenuItem(GLUTmenu
* menu
,
735 Window win
, int *which
);
736 extern void __glutStartMenu(GLUTmenu
* menu
,
737 GLUTwindow
* window
, int x
, int y
, int x_win
, int y_win
);
738 extern void __glutFinishMenu(Window win
, int x
, int y
);
740 extern void __glutSetMenu(GLUTmenu
* menu
);
742 /* private routines from glut_util.c */
743 extern char * __glutStrdup(const char *string
);
744 extern void __glutWarning(char *format
,...);
745 extern void __glutFatalError(char *format
,...);
746 extern void __glutFatalUsage(char *format
,...);
748 /* private routines from glut_win.c */
749 extern GLUTwindow
*__glutGetWindow(Window win
);
750 extern void __glutChangeWindowEventMask(long mask
, Bool add
);
751 extern XVisualInfo
*__glutDetermineVisual(
754 XVisualInfo
* (getVisualInfo
) (unsigned int));
755 extern XVisualInfo
*__glutGetVisualInfo(unsigned int mode
);
756 extern void __glutSetWindow(GLUTwindow
* window
);
757 extern void __glutReshapeFunc(GLUTreshapeCB reshapeFunc
,
758 int callingConvention
);
759 extern void GLUTCALLBACK
__glutDefaultReshape(int, int);
760 extern GLUTwindow
*__glutCreateWindow(
762 int x
, int y
, int width
, int height
, int gamemode
);
763 extern void __glutDestroyWindow(
765 GLUTwindow
* initialWindow
);
768 /* private routines from glut_glxext.c */
769 extern int __glutIsSupportedByGLX(char *);
770 extern int __glut_glXBindChannelToWindowSGIX(Display
*dpy
, int screen
,
771 int channel
, Window window
);
772 extern int __glut_glXChannelRectSGIX(Display
*dpy
, int screen
, int channel
,
773 int x
, int y
, int w
, int h
);
774 extern int __glut_glXQueryChannelRectSGIX(Display
*dpy
, int screen
,
775 int channel
, int *x
, int *y
,
777 extern int __glut_glXQueryChannelDeltasSGIX(Display
*dpy
, int screen
,
778 int channel
, int *dx
, int *dy
,
780 extern int __glut_glXChannelRectSyncSGIX(Display
*dpy
, int screen
, int channel
,
782 extern GLXContext
__glut_glXCreateContextWithConfigSGIX(Display
*dpy
,
783 GLXFBConfigSGIX config
,
785 GLXContext share_list
,
787 extern int __glut_glXGetFBConfigAttribSGIX(Display
*dpy
,
788 GLXFBConfigSGIX config
,
791 extern GLXFBConfigSGIX
__glut_glXGetFBConfigFromVisualSGIX(Display
*dpy
,
795 /* private routines from glut_input.c */
796 extern void __glutUpdateInputDeviceMask(GLUTwindow
* window
);
798 /* private routines from glut_mesa.c */
799 extern void __glutDetermineMesaSwapHackSupport(void);
801 /* private routines from glut_gameglut.c */
802 extern void __glutCloseDownGameMode(void);
804 /* private variables from glut_swap.c (BrianP) */
805 extern GLint __glutFPS
;
806 extern GLint __glutSwapCount
;
807 extern GLint __glutSwapTime
;
810 /* private routines from win32_*.c */
811 extern LONG WINAPI
__glutWindowProc(HWND win
, UINT msg
, WPARAM w
, LPARAM l
);
815 #endif /* __glutint_h__ */