Fixing two minor bugs, adding comments

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@697 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2006-09-21 17:33:56 +00:00
parent d4e5d7ed27
commit 22deb0baa1
5 changed files with 26 additions and 9 deletions

View File

@ -1184,3 +1184,15 @@ original GLUT.
(306) Changed "fgStructure.GameMode" to "fgStructure.GameModeWindow" to (306) Changed "fgStructure.GameMode" to "fgStructure.GameModeWindow" to
reflect better what it is 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

View File

@ -77,13 +77,15 @@ LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
#define strdup _strdup #define strdup _strdup
#endif #endif
/* Those files should be available on every platform. */ /* These files should be available on every platform. */
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h> #include <GL/glu.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
/* These are included based on autoconf directives. */
#if HAVE_SYS_TYPES_H #if HAVE_SYS_TYPES_H
# include <sys/types.h> # include <sys/types.h>
#endif #endif
@ -126,6 +128,8 @@ LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
# define FALSE 0 # define FALSE 0
#endif #endif
/* General defines */
#define INVALID_MODIFIERS 0xffffffff #define INVALID_MODIFIERS 0xffffffff
/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */ /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
@ -284,7 +288,7 @@ struct tagSFG_Display
int DisplayPointerX; /* saved X location of the pointer */ int DisplayPointerX; /* saved X location of the pointer */
int DisplayPointerY; /* saved Y location of the pointer */ int DisplayPointerY; /* saved Y location of the pointer */
#endif #endif /* X_XF86VidModeGetModeLine */
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
HINSTANCE Instance; /* The application's instance */ HINSTANCE Instance; /* The application's instance */

View File

@ -980,7 +980,7 @@ static void fghJoystickAddHatElement ( SFG_Joystick *joy, CFDictionaryRef button
http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp http://msdn.microsoft.com/archive/en-us/dnargame/html/msdn_sidewind3d.asp
*/ */
# if defined(_MSC_VER) # if defined(_MSC_VER)
# pragma comment (lib, "advapi32.lib") # pragma comment (lib, "advapi32.lib") /* library pragmas are bad */
# endif # endif
static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_sz ) static int fghJoystickGetOEMProductName ( SFG_Joystick* joy, char *buf, int buf_sz )

View File

@ -1404,7 +1404,7 @@ void FGAPIENTRY glutMainLoopEvent( void )
break; /* XXX Should disable this event */ break; /* XXX Should disable this event */
default: default:
fgWarning ("Unknown X event type: %d", event.type); fgWarning ("Unknown X event type: %d\n", event.type);
break; break;
} }
} }

View File

@ -30,7 +30,7 @@
#if TARGET_HOST_WINCE #if TARGET_HOST_WINCE
#include <aygshell.h> #include <aygshell.h>
#pragma comment( lib, "Aygshell.lib" ) #pragma comment( lib, "Aygshell.lib" ) /* library pragmas are bad */
static wchar_t* fghWstrFromStr(const char* str) static wchar_t* fghWstrFromStr(const char* str)
{ {
@ -764,10 +764,11 @@ void FGAPIENTRY glutSetWindow( int ID )
*/ */
int FGAPIENTRY glutGetWindow( void ) int FGAPIENTRY glutGetWindow( void )
{ {
SFG_Window *win = fgStructure.CurrentWindow;
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGetWindow" ); FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGetWindow" );
if( fgStructure.CurrentWindow == NULL ) while ( win && win->IsMenu )
return 0; win = win->Parent;
return fgStructure.CurrentWindow->ID; return win ? win->ID : 0;
} }
/* /*