#if TARGET_HOST_WINCE
#include <aygshell.h>
-#pragma comment( lib, "Aygshell.lib" )
+#pragma comment( lib, "Aygshell.lib" ) /* library pragmas are bad */
static wchar_t* fghWstrFromStr(const char* str)
{
if( fgState.DisplayMode & GLUT_DOUBLE )
flags |= PFD_DOUBLEBUFFER;
+ if( fgState.DisplayMode & GLUT_STEREO )
+ flags |= PFD_STEREO;
+
#if defined(_MSC_VER)
#pragma message( "fgSetupPixelFormat(): there is still some work to do here!" )
#endif
mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;
- if( window->IsMenu )
+ if( window->IsMenu || ( gameMode == GL_TRUE ) )
{
winAttr.override_redirect = True;
mask |= CWOverrideRedirect;
{
fgStructure.MenuContext =
(SFG_MenuContext *)malloc( sizeof(SFG_MenuContext) );
- fgStructure.MenuContext->VisualInfo = window->Window.VisualInfo;
- fgStructure.MenuContext->Context = glXCreateContext(
- fgDisplay.Display, fgStructure.MenuContext->VisualInfo,
+ fgStructure.MenuContext->MVisualInfo = window->Window.VisualInfo;
+ fgStructure.MenuContext->MContext = glXCreateContext(
+ fgDisplay.Display, fgStructure.MenuContext->MVisualInfo,
NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
);
}
- /* window->Window.Context = fgStructure.MenuContext->Context; */
+ /* window->Window.Context = fgStructure.MenuContext->MContext; */
window->Window.Context = glXCreateContext(
fgDisplay.Display, window->Window.VisualInfo,
NULL, ( fgState.DirectContext != GLUT_FORCE_INDIRECT_CONTEXT )
&wmHints,
NULL
);
+ XFree( textProperty.value );
XSetWMProtocols( fgDisplay.Display, window->Window.Handle,
&fgDisplay.DeleteWindow, 1 );
#if TARGET_HOST_UNIX_X11
glXDestroyContext( fgDisplay.Display, window->Window.Context );
+ XFree( window->Window.VisualInfo );
XDestroyWindow( fgDisplay.Display, window->Window.Handle );
XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
*/
int FGAPIENTRY glutCreateWindow( const char* title )
{
+ /* XXX GLUT does not exit; it simply calls "glutInit" quietly if the
+ * XXX application has not already done so. The "freeglut" community
+ * XXX decided not to go this route (freeglut-developer e-mail from
+ * XXX Steve Baker, 12/16/04, 4:22 PM CST, "Re: [Freeglut-developer]
+ * XXX Desired 'freeglut' behaviour when there is no current window"
+ */
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutCreateWindow" );
return fgCreateWindow( NULL, title, fgState.Position.X, fgState.Position.Y,
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutCreateSubWindow" );
parent = fgWindowByID( parentID );
freeglut_return_val_if_fail( parent != NULL, 0 );
+ if ( x < 0 )
+ {
+ x = parent->State.Width + x ;
+ if ( w >= 0 ) x -= w ;
+ }
+
+ if ( w < 0 ) w = parent->State.Width - x + w ;
+ if ( w < 0 )
+ {
+ x += w ;
+ w = -w ;
+ }
+
+ if ( y < 0 )
+ {
+ y = parent->State.Height + y ;
+ if ( h >= 0 ) y -= h ;
+ }
+
+ if ( h < 0 ) h = parent->State.Height - y + h ;
+ if ( h < 0 )
+ {
+ y += h ;
+ h = -h ;
+ }
+
window = fgCreateWindow( parent, "", x, y, w, h, GL_FALSE, GL_FALSE );
ret = window->ID;
*/
int FGAPIENTRY glutGetWindow( void )
{
+ SFG_Window *win = fgStructure.CurrentWindow;
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGetWindow" );
- if( fgStructure.CurrentWindow == NULL )
- return 0;
- return fgStructure.CurrentWindow->ID;
+ while ( win && win->IsMenu )
+ win = win->Parent;
+ return win ? win->ID : 0;
}
/*