cleanup and some WGL PIXELFORMAT issues
[mesa.git] / src / glut / glx / glut_win.c
index d03829c3a1a5e0fe7c0782d549bd1c0706c6dcb3..4b044d084d4c0bc5fcf03769996fdcc08cc2bc30 100644 (file)
@@ -130,7 +130,7 @@ __glutGetWindow(Window win)
 }
 
 /* CENTRY */
-int APIENTRY
+int GLUTAPIENTRY
 glutGetWindow(void)
 {
   if (__glutCurrentWindow) {
@@ -177,7 +177,7 @@ __glutSetWindow(GLUTwindow * window)
 }
 
 /* CENTRY */
-void APIENTRY
+void GLUTAPIENTRY
 glutSetWindow(int win)
 {
   GLUTwindow *window;
@@ -328,11 +328,16 @@ getVisualInfoRGB(unsigned int mode)
       list[n++] = 1;
     }
   }
-#if defined(GLX_VERSION_1_1) && defined(GLX_SGIS_multisample)
+#if defined(GLX_VERSION_1_1) && (defined(GLX_SGIS_multisample) || defined(GLX_ARB_multisample))
   if (GLUT_WIND_IS_MULTISAMPLE(mode)) {
-    if (!__glutIsSupportedByGLX("GLX_SGIS_multisample"))
+    if (!__glutIsSupportedByGLX("GLX_SGIS_multisample") &&
+        !__glutIsSupportedByGLX("GLX_ARB_multisample"))
       return NULL;
+#if defined(GLX_ARB_multisample)
+    list[n++] = GLX_SAMPLES_ARB;
+#elif defined(GLX_SGIS_multisample)
     list[n++] = GLX_SAMPLES_SGIS;
+#endif
     /* XXX Is 4 a reasonable minimum acceptable number of
        samples? */
     list[n++] = 4;
@@ -577,7 +582,7 @@ __glutCreateWindow(GLUTwindow * parent,
   window->renderWin = window->win;
 #if defined(GLX_VERSION_1_1) && defined(GLX_SGIX_fbconfig)
   if (fbc) {
-    window->ctx = glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
+    window->ctx = __glut_glXCreateContextWithConfigSGIX(__glutDisplay, fbc,
       GLX_RGBA_TYPE_SGIX, None, __glutTryDirect);
   } else
 #endif
@@ -690,7 +695,7 @@ __glutCreateWindow(GLUTwindow * parent,
 }
 
 /* CENTRY */
-int APIENTRY
+int GLUTAPIENTRY
 glutCreateWindow(const char *title)
 {
   static int firstWindow = 1;
@@ -737,7 +742,7 @@ glutCreateWindow(const char *title)
 }
 
 #ifdef _WIN32
-int APIENTRY
+int GLUTAPIENTRY
 __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int))
 {
   __glutExitFunc = exitfunc;
@@ -745,7 +750,7 @@ __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int))
 }
 #endif
 
-int APIENTRY
+int GLUTAPIENTRY
 glutCreateSubWindow(int win, int x, int y, int width, int height)
 {
   GLUTwindow *window;
@@ -837,7 +842,7 @@ __glutDestroyWindow(GLUTwindow * window,
 }
 
 /* CENTRY */
-void APIENTRY
+void GLUTAPIENTRY
 glutDestroyWindow(int win)
 {
   GLUTwindow *window = __glutWindowList[win - 1];
@@ -881,7 +886,7 @@ __glutChangeWindowEventMask(long eventMask, Bool add)
   }
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutDisplayFunc(GLUTdisplayCB displayFunc)
 {
   /* XXX Remove the warning after GLUT 3.0. */
@@ -890,7 +895,7 @@ glutDisplayFunc(GLUTdisplayCB displayFunc)
   __glutCurrentWindow->display = displayFunc;
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutMouseFunc(GLUTmouseCB mouseFunc)
 {
   if (__glutCurrentWindow->mouse) {
@@ -912,7 +917,7 @@ glutMouseFunc(GLUTmouseCB mouseFunc)
   __glutCurrentWindow->mouse = mouseFunc;
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutMotionFunc(GLUTmotionCB motionFunc)
 {
   /* Hack.  Some window managers (4Dwm by default) will mask
@@ -943,7 +948,7 @@ glutMotionFunc(GLUTmotionCB motionFunc)
   __glutCurrentWindow->motion = motionFunc;
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
 {
   __glutChangeWindowEventMask(PointerMotionMask,
@@ -958,7 +963,7 @@ glutPassiveMotionFunc(GLUTpassiveCB passiveMotionFunc)
   __glutCurrentWindow->passive = passiveMotionFunc;
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutEntryFunc(GLUTentryCB entryFunc)
 {
   __glutChangeWindowEventMask(EnterWindowMask | LeaveWindowMask,
@@ -969,7 +974,7 @@ glutEntryFunc(GLUTentryCB entryFunc)
   }
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutWindowStatusFunc(GLUTwindowStatusCB windowStatusFunc)
 {
   __glutChangeWindowEventMask(VisibilityChangeMask,
@@ -990,7 +995,7 @@ visibilityHelper(int status)
     __glutCurrentWindow->visibility(GLUT_VISIBLE);
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
 {
   __glutCurrentWindow->visibility = visibilityFunc;
@@ -1000,7 +1005,7 @@ glutVisibilityFunc(GLUTvisibilityCB visibilityFunc)
     glutWindowStatusFunc(NULL);
 }
 
-void APIENTRY
+void GLUTAPIENTRY
 glutReshapeFunc(GLUTreshapeCB reshapeFunc)
 {
   if (reshapeFunc) {