From: <fa...@us...> - 2006-09-21 17:34:05
|
Revision: 697 http://svn.sourceforge.net/freeglut/?rev=697&view=rev Author: fayjf Date: 2006-09-21 10:33:56 -0700 (Thu, 21 Sep 2006) Log Message: ----------- Fixing two minor bugs, adding comments Modified Paths: -------------- trunk/freeglut/freeglut/ChangeLog trunk/freeglut/freeglut/src/freeglut_internal.h trunk/freeglut/freeglut/src/freeglut_joystick.c trunk/freeglut/freeglut/src/freeglut_main.c trunk/freeglut/freeglut/src/freeglut_window.c Modified: trunk/freeglut/freeglut/ChangeLog =================================================================== --- trunk/freeglut/freeglut/ChangeLog 2006-09-21 17:13:37 UTC (rev 696) +++ trunk/freeglut/freeglut/ChangeLog 2006-09-21 17:33:56 UTC (rev 697) @@ -1184,3 +1184,15 @@ (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 + Modified: trunk/freeglut/freeglut/src/freeglut_internal.h =================================================================== --- trunk/freeglut/freeglut/src/freeglut_internal.h 2006-09-21 17:13:37 UTC (rev 696) +++ trunk/freeglut/freeglut/src/freeglut_internal.h 2006-09-21 17:33:56 UTC (rev 697) @@ -77,13 +77,15 @@ #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 @@ -126,6 +128,8 @@ # define FALSE 0 #endif +/* General defines */ + #define INVALID_MODIFIERS 0xffffffff /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */ @@ -284,7 +288,7 @@ 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 */ Modified: trunk/freeglut/freeglut/src/freeglut_joystick.c =================================================================== --- trunk/freeglut/freeglut/src/freeglut_joystick.c 2006-09-21 17:13:37 UTC (rev 696) +++ trunk/freeglut/freeglut/src/freeglut_joystick.c 2006-09-21 17:33:56 UTC (rev 697) @@ -980,7 +980,7 @@ 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 ) Modified: trunk/freeglut/freeglut/src/freeglut_main.c =================================================================== --- trunk/freeglut/freeglut/src/freeglut_main.c 2006-09-21 17:13:37 UTC (rev 696) +++ trunk/freeglut/freeglut/src/freeglut_main.c 2006-09-21 17:33:56 UTC (rev 697) @@ -69,7 +69,7 @@ #endif #ifndef MIN -#define MIN(a,b) (((a)<(b)) ? (a) : (b)) +# define MIN(a,b) (((a)<(b)) ? (a) : (b)) #endif @@ -1404,7 +1404,7 @@ 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; } } Modified: trunk/freeglut/freeglut/src/freeglut_window.c =================================================================== --- trunk/freeglut/freeglut/src/freeglut_window.c 2006-09-21 17:13:37 UTC (rev 696) +++ trunk/freeglut/freeglut/src/freeglut_window.c 2006-09-21 17:33:56 UTC (rev 697) @@ -30,7 +30,7 @@ #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) { @@ -764,10 +764,11 @@ */ 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; } /* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |