configure: allow C{,XX}FLAGS override
[mesa.git] / src / glut / glx / glutint.h
index 292cc27729c7c92c0e5faec84ea28a9233cd7b8b..ba30af60f0abc9ea08d5e7caa18902ad4fac9a6b 100644 (file)
 #include <GL/glx.h>
 #endif
 
+#ifndef GLUT_BUILDING_LIB
 #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
 
+#include <GL/glut.h>
+
 #ifndef _WIN32
 /* added by BrianP: */
 #ifndef APIENTRY
 /* 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. */
 
-/* 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. */
-#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
-#endif /* MESA */
-
 #ifdef SUPPORT_FORTRAN
 #include <GL/glutf90.h>
 #endif
@@ -569,27 +550,27 @@ typedef struct {
 #ifdef _WIN32
 #define MAKE_CURRENT_LAYER(window)                                    \
   {                                                                   \
-    HGLRC currentContext = GetCurrentContext();                       \
-    HDC currentDc = GetCurrentDC();                                   \
+    HGLRC currentContext = wglGetCurrentContext();                    \
+    HDC currentDc = wglGetCurrentDC();                                \
                                                                       \
     if (currentContext != window->renderCtx                           \
       || currentDc != window->renderDc) {                             \
-      MakeCurrent(window->renderDc, window->renderCtx);               \
+      wglMakeCurrent(window->renderDc, window->renderCtx);            \
     }                                                                 \
   }
 #define MAKE_CURRENT_WINDOW(window)                                   \
   {                                                                   \
-    HGLRC currentContext = GetCurrentContext();                       \
-    HDC currentDc = GetCurrentDC();                                   \
+    HGLRC currentContext = wglGetCurrentContext();                    \
+    HDC currentDc = wglGetCurrentDC();                                \
                                                                       \
     if (currentContext != window->ctx || currentDc != window->hdc) {  \
-      MakeCurrent(window->hdc, window->ctx);                          \
+      wglMakeCurrent(window->hdc, window->ctx);                       \
     }                                                                 \
   }
 #define MAKE_CURRENT_OVERLAY(overlay) \
-  MakeCurrent(overlay->hdc, overlay->ctx)
+  wglMakeCurrent(overlay->hdc, overlay->ctx)
 #define UNMAKE_CURRENT() \
-  MakeCurrent(NULL, NULL)
+  wglMakeCurrent(NULL, NULL)
 #define SWAP_BUFFERS_WINDOW(window) \
   SwapBuffers(window->hdc)
 #define SWAP_BUFFERS_LAYER(window) \
@@ -661,6 +642,7 @@ extern unsigned int __glutModifierMask;
 #ifdef _WIN32
 extern void (__cdecl *__glutExitFunc)(int retval);
 #endif
+extern char *__glutPPMFile;
 
 /* private variables from glut_menu.c */
 extern GLUTmenuItem *__glutItemSelected;
@@ -681,6 +663,9 @@ extern void __glutFreeOverlay(GLUToverlay * overlay);
 extern XVisualInfo *__glutDetermineWindowVisual(Bool * treatAsSingle,
   Bool * visAlloced, void **fbc);
 
+/* private variables from glut_ppm.c */
+extern void __glutWritePPMFile(void);
+
 /* private variables from glut_mesa.c */
 extern int __glutMesaSwapHackSupport;
 
@@ -764,6 +749,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 */
@@ -773,7 +781,12 @@ extern void  __glutUpdateInputDeviceMask(GLUTwindow * window);
 extern void __glutDetermineMesaSwapHackSupport(void);
 
 /* private routines from glut_gameglut.c */
-extern void GLUTAPIENTRYV __glutCloseDownGameMode(void);
+extern void __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 */
@@ -781,4 +794,5 @@ extern LONG WINAPI __glutWindowProc(HWND win, UINT msg, WPARAM w, LPARAM l);
 extern HDC XHDC;
 #endif
 
+
 #endif /* __glutint_h__ */