(306) Changed "fgStructure.GameMode" to "fgStructure.GameModeWindow" to
reflect better what it is
+**************************************************************************
+* Changes on September 21, 2006
+**************************************************************************
+
+(307) Added an end-of-line character to a warning message about an unknown
+X event type
+
+(308) Fixing a problem in which "glutGetWindow" would return a menu's window
+instead of the menu's parent window
+
+(309) Added some handy comments, spacing, fixed a typo in a comment
+
#define strdup _strdup
#endif
-/* Those files should be available on every platform. */
+/* These files should be available on every platform. */
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
+
+/* These are included based on autoconf directives. */
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
# define FALSE 0
#endif
+/* General defines */
+
#define INVALID_MODIFIERS 0xffffffff
/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
int DisplayPointerX; /* saved X location of the pointer */
int DisplayPointerY; /* saved Y location of the pointer */
-#endif
+#endif /* X_XF86VidModeGetModeLine */
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
HINSTANCE Instance; /* The application's instance */
http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp
*/
# if defined(_MSC_VER)
-# pragma comment (lib, "advapi32.lib")
+# pragma comment (lib, "advapi32.lib") /* library pragmas are bad */
# endif
static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_sz )
#endif
#ifndef MIN
-#define MIN(a,b) (((a)<(b)) ? (a) : (b))
+# define MIN(a,b) (((a)<(b)) ? (a) : (b))
#endif
break; /* XXX Should disable this event */
default:
- fgWarning ("Unknown X event type: %d", event.type);
+ fgWarning ("Unknown X event type: %d\n", event.type);
break;
}
}
#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)
{
*/
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;
}
/*