-
- return fgPlatformGetConfig( GLX_VISUAL_ID );
-
- default:
- fgWarning( "glutGet(): missing enum handle %d", eWhat );
- break;
- }
-
- return -1;
-}
-
-
-int fgPlatformGlutDeviceGet ( GLenum eWhat )
-{
- switch( eWhat )
- {
- case GLUT_HAS_KEYBOARD:
- /*
- * X11 has a core keyboard by definition, although it can
- * be present as a virtual/dummy keyboard. For now, there
- * is no reliable way to tell if a real keyboard is present.
- */
- return 1;
-
- /* X11 has a mouse by definition */
- case GLUT_HAS_MOUSE:
- return 1 ;
-
- case GLUT_NUM_MOUSE_BUTTONS:
- /* We should be able to pass NULL when the last argument is zero,
- * but at least one X server has a bug where this causes a segfault.
- *
- * In XFree86/Xorg servers, a mouse wheel is seen as two buttons
- * rather than an Axis; "freeglut_main.c" expects this when
- * checking for a wheel event.
- */
- {
- unsigned char map;
- int nbuttons = XGetPointerMapping(fgDisplay.pDisplay.Display, &map,0);
- return nbuttons;
- }
-
- default:
- fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat );
- break;
- }
-
- /* And now -- the failure. */
- return -1;
-}
-
-
-int *fgPlatformGlutGetModeValues(GLenum eWhat, int *size)
-{
- int *array;
-
- int attributes[9];
- GLXFBConfig * fbconfigArray; /* Array of FBConfigs */
- int fbconfigArraySize; /* Number of FBConfigs in the array */
- int attribute_name = 0;
-
- array = NULL;
- *size = 0;
-
- switch (eWhat)
- {
- case GLUT_AUX:
- case GLUT_MULTISAMPLE:
-
- attributes[0] = GLX_BUFFER_SIZE;
- attributes[1] = GLX_DONT_CARE;
-
- switch (eWhat)
- {
- case GLUT_AUX:
- /*
- FBConfigs are now sorted by increasing number of auxiliary
- buffers. We want at least one buffer.
- */
- attributes[2] = GLX_AUX_BUFFERS;
- attributes[3] = 1;
- attributes[4] = None;
-
- attribute_name = GLX_AUX_BUFFERS;
-
- break;
-
-
- case GLUT_MULTISAMPLE:
- attributes[2] = GLX_AUX_BUFFERS;
- attributes[3] = GLX_DONT_CARE;
- attributes[4] = GLX_SAMPLE_BUFFERS;
- attributes[5] = 1;
- /*
- FBConfigs are now sorted by increasing number of samples per
- pixel. We want at least one sample.
- */
- attributes[6] = GLX_SAMPLES;
- attributes[7] = 1;
- attributes[8] = None;
-
- attribute_name = GLX_SAMPLES;
-
- break;