added glutGetProcAddress() and GLUT_FPS env var option
[mesa.git] / src / glut / glx / glutint.h
index df92f191a39311b0fd65d1a0a171fc1cf30ee006..5e06bfc435eb6637a1d29be56c26974f6dacd75b 100644 (file)
@@ -7,6 +7,10 @@
    and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+#endif
+
 #if defined(__CYGWIN32__)
 #include <sys/time.h>
 #endif
 #else
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#define GLX_GLXEXT_PROTOTYPES
 #include <GL/glx.h>
 #endif
 
-/* added by BrianP: */
+#define GLUT_BUILDING_LIB  /* Building the GLUT library itself. */
+#include <GL/glut.h>
+
+#if defined(MESA) && defined(_WIN32) && !defined(__CYGWIN32__)
+#include <gl/mesa_wgl.h>
+#endif
+
 #ifndef _WIN32
+/* added by BrianP: */
+#ifndef APIENTRY
 #define APIENTRY GLAPIENTRY
+#endif
 #define __cdecl GLAPIENTRY
 #define CDECL GLAPIENTRY
 #endif
 
-#define GLUT_BUILDING_LIB  /* Building the GLUT library itself. */
-
 /* GLUT_BUILDING_LIB is used by <GL/glut.h> to 1) not #pragma link
    with the GLUT library, and 2) avoid the Win32 atexit hack. */
 
-#include <GL/glut.h>
-
 /* This must be done after <GL/gl.h> is included.  MESA is defined
    if the <GL/gl.h> is supplied by Brian Paul's Mesa library. */
 #if defined(MESA) && defined(_WIN32)
 /* Mesa implements "wgl" versions of GDI entry points needed for
    using OpenGL.  Map these "wgl" versions to the GDI names via
    macros. */
-GLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, CONST PIXELFORMATDESCRIPTOR *ppfd);
-GLAPI int GLAPIENTRY wglDescribePixelFormat(HDC hdc,int iPixelFormat,UINT nBytes, LPPIXELFORMATDESCRIPTOR ppfd);
-GLAPI int GLAPIENTRY wglGetPixelFormat(HDC hdc);
-GLAPI BOOL GLAPIENTRY wglSetPixelFormat(HDC hdc, int iPixelFormat, CONST PIXELFORMATDESCRIPTOR *ppfd);
-GLAPI BOOL GLAPIENTRY wglSwapBuffers(HDC hdc);
-GLAPI HGLRC GLWINAPI wglCreateContext(HDC hdc);
-GLAPI BOOL GLWINAPI wglDeleteContext(HGLRC hglrc);
-GLAPI HGLRC GLWINAPI wglGetCurrentContext(VOID);
-GLAPI HDC GLWINAPI wglGetCurrentDC(VOID);
-GLAPI BOOL GLWINAPI wglMakeCurrent(HDC hdc,HGLRC hglrc);
-#define ChoosePixelFormat wglChoosePixelFormat
+#define ChoosePixelFormat   wglChoosePixelFormat
 #define DescribePixelFormat wglDescribePixelFormat
-#define GetPixelFormat wglGetPixelFormat
-#define SetPixelFormat wglSetPixelFormat
-#define SwapBuffers wglSwapBuffers
-#define GetCurrentContext wglGetCurrentContext
-#define GetCurrentDC wglGetCurrentDC
-#define MakeCurrent wglMakeCurrent
-#define CreateContext wglCreateContext
-#define DeleteContext wglDeleteContext
+#define GetPixelFormat      wglGetPixelFormat
+#define SetPixelFormat      wglSetPixelFormat
+#define SwapBuffers         wglSwapBuffers
+#define GetCurrentContext   wglGetCurrentContext
+#define GetCurrentDC        wglGetCurrentDC
+#define MakeCurrent         wglMakeCurrent
+#define CreateContext       wglCreateContext
+#define DeleteContext       wglDeleteContext
 #endif /* MESA */
 
 #ifdef SUPPORT_FORTRAN
@@ -69,16 +69,17 @@ GLAPI BOOL GLWINAPI wglMakeCurrent(HDC hdc,HGLRC hglrc);
 
 #ifdef __vms
 #if ( __VMS_VER < 70000000 )
-struct timeval {
+#define OLD_VMS
+struct timeval6 {
   __int64 val;
 };
-extern int sys$gettim(struct timeval *);
+extern int sys$gettim(struct timeval6 *);
 #else
 #include <time.h>
 #endif
 #else
 #include <sys/types.h>
-#if !defined(_WIN32)
+#if !defined(_WIN32) || defined(__CYGWIN32__)
 #include <sys/time.h>
 #else
 #include <winsock.h>
@@ -530,8 +531,12 @@ struct _GLUTmenuItem {
 typedef struct _GLUTtimer GLUTtimer;
 struct _GLUTtimer {
   GLUTtimer *next;      /* list of timers */
-  struct timeval timeout;  /* time to be called */
-  GLUTtimerCB func;     /* timer  (value) */
+#ifdef OLD_VMS
+   struct timeval6 timeout;  /* time to be called */
+#else
+   struct timeval timeout;  /* time to be called */
+#endif
+   GLUTtimerCB func;     /* timer  (value) */
   int value;            /*  return value */
 #ifdef SUPPORT_FORTRAN
   GLUTtimerFCB ffunc;   /* Fortran timer  */
@@ -672,6 +677,7 @@ extern GLUTwindow *__glutMenuWindow;
 extern GLUTmenu *__glutCurrentMenu;
 extern int __glutWindowListSize;
 extern void (*__glutFreeOverlayFunc) (GLUToverlay *);
+extern void __glutFreeOverlay(GLUToverlay * overlay);
 extern XVisualInfo *__glutDetermineWindowVisual(Bool * treatAsSingle,
   Bool * visAlloced, void **fbc);
 
@@ -704,6 +710,7 @@ extern void __glutPutOnWorkList(GLUTwindow * window,
   int work_mask);
 extern void __glutRegisterEventParser(GLUTeventParser * parser);
 extern void __glutPostRedisplay(GLUTwindow * window, int layerMask);
+extern void handleTimeouts(void);
 
 /* private routines from glut_init.c */
 #if !defined(_WIN32)
@@ -711,7 +718,11 @@ extern void __glutOpenXConnection(char *display);
 #else
 extern void __glutOpenWin32Connection(char *display);
 #endif
+#ifdef OLD_VMS
+extern void __glutInitTime(struct timeval6 *beginning);
+#else
 extern void __glutInitTime(struct timeval *beginning);
+#endif
 
 /* private routines for glut_menu.c (or win32_menu.c) */
 #if defined(_WIN32)
@@ -753,6 +764,29 @@ extern void __glutDestroyWindow(
 #if !defined(_WIN32)
 /* private routines from glut_glxext.c */
 extern int __glutIsSupportedByGLX(char *);
+extern int __glut_glXBindChannelToWindowSGIX(Display *dpy, int screen,
+                                             int channel, Window window);
+extern int __glut_glXChannelRectSGIX(Display *dpy, int screen, int channel,
+                                     int x, int y, int w, int h);
+extern int __glut_glXQueryChannelRectSGIX(Display *dpy, int screen,
+                                          int channel, int *x, int *y,
+                                          int *w, int *h);
+extern int __glut_glXQueryChannelDeltasSGIX(Display *dpy, int screen,
+                                            int channel, int *dx, int *dy,
+                                            int *dw, int *dh);
+extern int __glut_glXChannelRectSyncSGIX(Display *dpy, int screen, int channel,
+                                         GLenum synctype);
+extern GLXContext __glut_glXCreateContextWithConfigSGIX(Display *dpy,
+                                                        GLXFBConfigSGIX config,
+                                                        int render_type,
+                                                        GLXContext share_list,
+                                                        Bool direct);
+extern int __glut_glXGetFBConfigAttribSGIX(Display *dpy,
+                                           GLXFBConfigSGIX config,
+                                           int attribute,
+                                           int *value);
+extern GLXFBConfigSGIX __glut_glXGetFBConfigFromVisualSGIX(Display *dpy,
+                                                           XVisualInfo *vis);
 #endif
 
 /* private routines from glut_input.c */
@@ -764,6 +798,11 @@ extern void __glutDetermineMesaSwapHackSupport(void);
 /* private routines from glut_gameglut.c */
 extern void GLUTAPIENTRYV __glutCloseDownGameMode(void);
 
+/* private variables from glut_swap.c (BrianP) */
+extern GLint __glutFPS;
+extern GLint __glutSwapCount;
+extern GLint __glutSwapTime;
+
 #if defined(_WIN32)
 /* private routines from win32_*.c */
 extern LONG WINAPI __glutWindowProc(HWND win, UINT msg, WPARAM w, LPARAM l);