* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#include <GL/freeglut.h>
#include "freeglut_internal.h"
ATTRIB_VAL( GLX_ACCUM_ALPHA_SIZE, 1 );
}
+ if( fgState.DisplayMode & GLUT_AUX1 )
+ ATTRIB_VAL( GLX_AUX_BUFFERS, 1 );
+ if( fgState.DisplayMode & GLUT_AUX2 )
+ ATTRIB_VAL( GLX_AUX_BUFFERS, 2 );
+ if( fgState.DisplayMode & GLUT_AUX3 )
+ ATTRIB_VAL( GLX_AUX_BUFFERS, 3 );
+ if( fgState.DisplayMode & GLUT_AUX4 )
+ ATTRIB_VAL( GLX_AUX_BUFFERS, 4 );
+
+
/* Push a null at the end of the list */
ATTRIB( None );
XSizeHints sizeHints;
XWMHints wmHints;
unsigned long mask;
+ unsigned int current_DisplayMode = fgState.DisplayMode ;
- /*
- * XXX fgChooseVisual() is a common part of all three.
- * XXX With a little thought, we should be able to greatly
- * XXX simplify this.
- */
- if( !window->IsMenu )
- window->Window.VisualInfo = fgChooseVisual( );
- else if( fgStructure.MenuContext )
- window->Window.VisualInfo = fgChooseVisual( );
- else
- {
- /* XXX Why are menus double- and depth-buffered? */
- unsigned int current_DisplayMode = fgState.DisplayMode ;
- fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ;
- window->Window.VisualInfo = fgChooseVisual( );
+ /* Save the display mode if we are creating a menu window */
+ if( window->IsMenu && ( ! fgStructure.MenuContext ) )
+ fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB ;
+
+ window->Window.VisualInfo = fgChooseVisual( );
+
+ if( window->IsMenu && ( ! fgStructure.MenuContext ) )
fgState.DisplayMode = current_DisplayMode ;
- }
if( ! window->Window.VisualInfo )
{
}
FREEGLUT_INTERNAL_ERROR_EXIT( window->Window.VisualInfo != NULL,
- "Unable to get window visual info", "fgOpenWindow" );
+ "Visual with necessary capabilities not found", "fgOpenWindow" );
/*
* XXX HINT: the masks should be updated when adding/removing callbacks.
*/
winAttr.event_mask =
StructureNotifyMask | SubstructureNotifyMask | ExposureMask |
- ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyRelease |
+ ButtonPressMask | ButtonReleaseMask | KeyPressMask | KeyReleaseMask |
VisibilityChangeMask | EnterWindowMask | LeaveWindowMask |
PointerMotionMask | ButtonMotionMask;
winAttr.background_pixmap = None;
}
#endif
- glXMakeCurrent(
- fgDisplay.Display,
- window->Window.Handle,
- window->Window.Context
- );
-
/*
* XXX Assume the new window is visible by default
* XXX Is this a safe assumption?
* that they should replace a window manager that they like, and which
* works, just because *we* think that it's not "modern" enough.
*/
-#if TARGET_HOST_WINCE /* Since this is in the X11 branch, it's pretty dumb */
- sizeHints.x = 0;
- sizeHints.y = 0;
- sizeHints.width = 320;
- sizeHints.height = 240;
-#else
sizeHints.x = x;
sizeHints.y = y;
sizeHints.width = w;
sizeHints.height = h;
-#endif /* TARGET_HOST_WINCE */
wmHints.flags = StateHint;
wmHints.initial_state = fgState.ForceIconic ? IconicState : NormalState;
XSetWMProtocols( fgDisplay.Display, window->Window.Handle,
&fgDisplay.DeleteWindow, 1 );
+ glXMakeCurrent(
+ fgDisplay.Display,
+ window->Window.Handle,
+ window->Window.Context
+ );
+
XMapWindow( fgDisplay.Display, window->Window.Handle );
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE