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 );
- if ( fgState.DisplayMode & GLUT_MULTISAMPLE )
- {
- ATTRIB_VAL( GLX_SAMPLE_BUFFERS, 1 );
- }
-
+ if ((fgState.DisplayMode & GLUT_AUX)
+ || (fgState.DisplayMode & GLUT_AUX1)
+ || (fgState.DisplayMode & GLUT_AUX2)
+ || (fgState.DisplayMode & GLUT_AUX3)
+ || (fgState.DisplayMode & GLUT_AUX4))
+ {
+ ATTRIB_VAL(GLX_AUX_BUFFERS, fgState.AuxiliaryBufferNumber)
+ }
+
+ if (fgState.DisplayMode & GLUT_MULTISAMPLE)
+ {
+ ATTRIB_VAL(GLX_SAMPLE_BUFFERS, 1)
+ ATTRIB_VAL(GLX_SAMPLES, fgState.SampleNumber)
+ }
/* Push a null at the end of the list */
ATTRIB( None );
{
fgStructure.MenuContext =
(SFG_MenuContext *)malloc( sizeof(SFG_MenuContext) );
- fgStructure.MenuContext->Context = glXCreateNewContext(
+ fgStructure.MenuContext->MContext = glXCreateNewContext(
fgDisplay.Display, *(window->Window.FBConfig), renderType,
NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
);
}
/* window->Window.Context = fgStructure.MenuContext->MContext; */
- window->Window.Context = glXCreateContext(
- fgDisplay.Display, window->Window.FBConfig, renderType,
+ window->Window.Context = glXCreateNewContext(
+ fgDisplay.Display, *(window->Window.FBConfig), renderType,
NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
);
}
if( ! window->Window.Context )
window->Window.Context = glXCreateNewContext(
- fgDisplay.Display, window->Window.FBConfig, renderType,
+ fgDisplay.Display, *(window->Window.FBConfig), renderType,
NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
);
}
else
window->Window.Context = glXCreateNewContext(
- fgDisplay.Display, window->Window.FBConfig, renderType,
+ fgDisplay.Display, *(window->Window.FBConfig), renderType,
NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
);
SetWindowLong ( window->Window.Handle, GWL_STYLE,
WindowStyle & ~(WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX));
}
-//SetWindowPos(window->Window.Handle, NULL, 0, 0, 0, 0,
-// SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
+/* SetWindowPos(window->Window.Handle, NULL, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); */
#if defined(_WIN32_WCE)
glXDestroyContext( fgDisplay.Display, window->Window.Context );
XFree( window->Window.FBConfig );
XDestroyWindow( fgDisplay.Display, window->Window.Handle );
- XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
+ /* XFlush( fgDisplay.Display ); */ /* XXX Shouldn't need this */
#elif TARGET_HOST_MS_WINDOWS
{
#if TARGET_HOST_POSIX_X11
- int x, y;
- Window w;
- XMoveResizeWindow(
- fgDisplay.Display,
- fgStructure.CurrentWindow->Window.Handle,
- 0, 0,
- fgDisplay.ScreenWidth,
- fgDisplay.ScreenHeight
- );
+ Status status; /* Returned by XGetWindowAttributes(), not checked. */
+ XWindowAttributes attributes;
- XFlush( fgDisplay.Display ); /* This is needed */
-
- XTranslateCoordinates(
- fgDisplay.Display,
- fgStructure.CurrentWindow->Window.Handle,
- fgDisplay.RootWindow,
- 0, 0, &x, &y, &w
- );
+ status = XGetWindowAttributes(fgDisplay.Display,
+ fgStructure.CurrentWindow->Window.Handle,
+ &attributes);
+ /*
+ * The "x" and "y" members of "attributes" are the window's coordinates
+ * relative to its parent, i.e. to the decoration window.
+ */
+ XMoveResizeWindow(fgDisplay.Display,
+ fgStructure.CurrentWindow->Window.Handle,
+ -attributes.x,
+ -attributes.y,
+ fgDisplay.ScreenWidth,
+ fgDisplay.ScreenHeight);
- if (x || y)
- {
- XMoveWindow(
- fgDisplay.Display,
- fgStructure.CurrentWindow->Window.Handle,
- -x, -y
- );
- XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
- }
#elif TARGET_HOST_MS_WINDOWS && !defined(_WIN32_WCE) /* FIXME: what about WinCE */
RECT rect;