XParseGeometry include now compiles with windows (VS2010, didn't touch

cmake)
Various typos in comments
Some other cleanup and formatting
glutInitDisplayString now understands "borderless"


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1095 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2012-03-10 02:03:32 +00:00
parent 4ce337a008
commit 8197972757
10 changed files with 33 additions and 54 deletions

View File

@ -344,6 +344,7 @@
<ClCompile Include="..\..\src\Common\freeglut_teapot.c" /> <ClCompile Include="..\..\src\Common\freeglut_teapot.c" />
<ClCompile Include="..\..\src\Common\freeglut_videoresize.c" /> <ClCompile Include="..\..\src\Common\freeglut_videoresize.c" />
<ClCompile Include="..\..\src\Common\freeglut_window.c" /> <ClCompile Include="..\..\src\Common\freeglut_window.c" />
<ClCompile Include="..\..\src\Common\xparsegeometry_repl.c" />
<ClCompile Include="..\..\src\mswin\freeglut_cursor_mswin.c" /> <ClCompile Include="..\..\src\mswin\freeglut_cursor_mswin.c" />
<ClCompile Include="..\..\src\mswin\freeglut_display_mswin.c" /> <ClCompile Include="..\..\src\mswin\freeglut_display_mswin.c" />
<ClCompile Include="..\..\src\mswin\freeglut_ext_mswin.c" /> <ClCompile Include="..\..\src\mswin\freeglut_ext_mswin.c" />
@ -368,6 +369,7 @@
<ClInclude Include="..\..\include\GL\freeglut_std.h" /> <ClInclude Include="..\..\include\GL\freeglut_std.h" />
<ClInclude Include="..\..\src\Common\freeglut_teapot_data.h" /> <ClInclude Include="..\..\src\Common\freeglut_teapot_data.h" />
<ClInclude Include="..\..\include\GL\glut.h" /> <ClInclude Include="..\..\include\GL\glut.h" />
<ClInclude Include="..\..\src\Common\xparsegeometry_repl.h" />
<ClInclude Include="..\..\src\mswin\freeglut_internal_mswin.h" /> <ClInclude Include="..\..\src\mswin\freeglut_internal_mswin.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -126,6 +126,9 @@
<ClCompile Include="..\..\src\mswin\freeglut_window_mswin.c"> <ClCompile Include="..\..\src\mswin\freeglut_window_mswin.c">
<Filter>Source Files\mswin</Filter> <Filter>Source Files\mswin</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\Common\xparsegeometry_repl.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\..\src\Common\freeglutdll.def"> <None Include="..\..\src\Common\freeglutdll.def">
@ -154,6 +157,9 @@
<ClInclude Include="..\..\src\mswin\freeglut_internal_mswin.h"> <ClInclude Include="..\..\src\mswin\freeglut_internal_mswin.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\src\Common\xparsegeometry_repl.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ResourceCompile Include="..\..\freeglut.rc"> <ResourceCompile Include="..\..\freeglut.rc">

View File

@ -315,9 +315,8 @@ void fgDeinitialize( void )
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */ /* -- INTERFACE FUNCTIONS -------------------------------------------------- */
#if !TARGET_HOST_POSIX_X11 #if !TARGET_HOST_POSIX_X11
#include "Common/xparsegeometry_repl.h" # include "../Common/xparsegeometry_repl.h"
#endif #endif
/* /*
@ -499,7 +498,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
configuration is conformant or not */ configuration is conformant or not */
break ; break ;
case 6 : /* "depth": Number of bits of precsion in the depth buffer */ case 6 : /* "depth": Number of bits of precision in the depth buffer */
glut_state_flag |= GLUT_DEPTH ; /* Somebody fix this for me! */ glut_state_flag |= GLUT_DEPTH ; /* Somebody fix this for me! */
break ; break ;
@ -619,8 +618,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
break ; break ;
case 35 : /* "borderless": windows should not have borders */ case 35 : /* "borderless": windows should not have borders */
#if TARGET_HOST_POSIX_X11 glut_state_flag |= GLUT_BORDERLESS;
#endif
break ; break ;
case 36 : /* "aux": some number of aux buffers */ case 36 : /* "aux": some number of aux buffers */
@ -646,7 +644,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion ) void FGAPIENTRY glutInitContextVersion( int majorVersion, int minorVersion )
{ {
/* We will make use of these valuse when creating a new OpenGL context... */ /* We will make use of these value when creating a new OpenGL context... */
fgState.MajorVersion = majorVersion; fgState.MajorVersion = majorVersion;
fgState.MinorVersion = minorVersion; fgState.MinorVersion = minorVersion;
} }
@ -684,4 +682,4 @@ void FGAPIENTRY glutInitWarningFunc( void (* vfgWarning) ( const char *fmt, va_l
fgState.WarningFunc = vfgWarning; fgState.WarningFunc = vfgWarning;
} }
/*** END OF FILE ***/ /*** END OF FILE ***/

View File

@ -941,11 +941,11 @@ SFG_Proc fgPlatformGetProcAddress( const char *procName );
#define ATTRIB(a) attributes[where++]=(a) #define ATTRIB(a) attributes[where++]=(a)
#define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);} #define ATTRIB_VAL(a,v) {ATTRIB(a); ATTRIB(v);}
extern int fghIsLegacyContextVersionRequested( void ); int fghIsLegacyContextVersionRequested( void );
extern int fghMapBit( int mask, int from, int to ); int fghMapBit( int mask, int from, int to );
extern int fghIsLegacyContextRequested( void ); int fghIsLegacyContextRequested( void );
extern void fghContextCreationError( void ); void fghContextCreationError( void );
extern int fghNumberOfAuxBuffersRequested( void ); int fghNumberOfAuxBuffersRequested( void );
#endif /* FREEGLUT_INTERNAL_H */ #endif /* FREEGLUT_INTERNAL_H */

View File

@ -47,14 +47,11 @@
* glutCreateSubWindow() -- Check when default position and size is {-1,-1} * glutCreateSubWindow() -- Check when default position and size is {-1,-1}
* glutDestroyWindow() -- check the Win32 version * glutDestroyWindow() -- check the Win32 version
* glutSetWindow() -- check the Win32 version * glutSetWindow() -- check the Win32 version
* glutGetWindow() -- OK
* glutSetWindowTitle() -- check the Win32 version * glutSetWindowTitle() -- check the Win32 version
* glutSetIconTitle() -- check the Win32 version * glutSetIconTitle() -- check the Win32 version
* glutShowWindow() -- check the Win32 version * glutShowWindow() -- check the Win32 version
* glutHideWindow() -- check the Win32 version * glutHideWindow() -- check the Win32 version
* glutIconifyWindow() -- check the Win32 version * glutIconifyWindow() -- check the Win32 version
* glutReshapeWindow() -- check the Win32 version
* glutPositionWindow() -- check the Win32 version
* glutPushWindow() -- check the Win32 version * glutPushWindow() -- check the Win32 version
* glutPopWindow() -- check the Win32 version * glutPopWindow() -- check the Win32 version
*/ */
@ -261,7 +258,7 @@ void FGAPIENTRY glutDestroyWindow( int windowID )
} }
/* /*
* This function selects the current window * This function selects the specified window as the current window
*/ */
void FGAPIENTRY glutSetWindow( int ID ) void FGAPIENTRY glutSetWindow( int ID )
{ {

View File

@ -32,10 +32,10 @@ from The Open Group.
*/ */
#include "Common/xparsegeometry_repl.h" #include "../Common/xparsegeometry_repl.h"
/* /*
* XParseGeometry parses strings of the form * XParseGeometry parses strings of the form
* "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where
* width, height, xoffset, and yoffset are unsigned integers. * width, height, xoffset, and yoffset are unsigned integers.
* Example: "=80x24+300-49" * Example: "=80x24+300-49"

View File

@ -42,11 +42,9 @@ from The Open Group.
#define XNegative 0x0010 #define XNegative 0x0010
#define YNegative 0x0020 #define YNegative 0x0020
extern int XParseGeometry ( extern int XParseGeometry (const char *string, /* INPUT */
const char *string, int *x, int *y, /* RETURN */
int *x, unsigned int *width, unsigned int *height); /* RETURN */
int *y,
unsigned int *width, /* RETURN */
unsigned int *height); /* RETURN */
#endif #endif

View File

@ -121,9 +121,10 @@ void fgPlatformInitialize( const char* displayName )
fgState.Initialised = GL_TRUE; fgState.Initialised = GL_TRUE;
/* Avoid registering atexit callback on Win32 as it results in an access /* Avoid registering atexit callback on Win32 as it can result in an
* violation due to calling into a module which has been unloaded. * access violation due to calling into a module which has been
* Any cleanup isn't needed on Windows anyway, the OS takes care of it.c * unloaded.
* Any cleanup isn't needed on Windows anyway, the OS takes care of it.
* see: http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx * see: http://blogs.msdn.com/b/oldnewthing/archive/2012/01/05/10253268.aspx
*/ */
/* atexit(fgDeinitialize); */ /* atexit(fgDeinitialize); */

View File

@ -69,8 +69,8 @@ LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay; typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay;
struct tagSFG_PlatformDisplay struct tagSFG_PlatformDisplay
{ {
HINSTANCE Instance; /* The application's instance */ HINSTANCE Instance; /* The application's instance */
DEVMODE DisplayMode; /* Desktop's display settings */ DEVMODE DisplayMode; /* Desktop's display settings */
char *DisplayName; /* Display name for multi display support*/ char *DisplayName; /* Display name for multi display support*/
}; };
@ -83,7 +83,7 @@ typedef HGLRC SFG_WindowContextType;
typedef struct tagSFG_PlatformContext SFG_PlatformContext; typedef struct tagSFG_PlatformContext SFG_PlatformContext;
struct tagSFG_PlatformContext struct tagSFG_PlatformContext
{ {
HDC Device; /* The window's device context */ HDC Device; /* The window's device context */
}; };
@ -91,31 +91,12 @@ struct tagSFG_PlatformContext
typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState; typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;
struct tagSFG_PlatformWindowState struct tagSFG_PlatformWindowState
{ {
RECT OldRect; /* window rect - stored before the window is made fullscreen */ RECT OldRect; /* window rect - stored before the window is made fullscreen */
DWORD OldStyle; /* window style - stored before the window is made fullscreen */ DWORD OldStyle; /* window style - stored before the window is made fullscreen */
}; };
/* For "freeglut_init.c", some definitions of symbols and a prototype to emulate the X11 functionality */
#define NoValue 0x0000
#define XValue 0x0001
#define YValue 0x0002
#define WidthValue 0x0004
#define HeightValue 0x0008
#define AllValues 0x000F
#define XNegative 0x0010
#define YNegative 0x0020
extern int XParseGeometry (
const char *string,
int *x,
int *y,
unsigned int *width, /* RETURN */
unsigned int *height); /* RETURN */
/* Joystick-Specific Definitions */ /* Joystick-Specific Definitions */
#if !defined(_WIN32_WCE) #if !defined(_WIN32_WCE)
# define _JS_MAX_AXES 8 # define _JS_MAX_AXES 8

View File

@ -250,10 +250,6 @@ int fgPlatformGlutDeviceGet ( GLenum eWhat )
/* /*
* Win32 is assumed a keyboard, and this cannot be queried, * Win32 is assumed a keyboard, and this cannot be queried,
* except for WindowsCE. * except for WindowsCE.
*
* X11 has a core keyboard by definition, although it can
* be present as a virtual/dummy keyboard. For now, there
* is no reliable way to tell if a real keyboard is present.
*/ */
#if defined(_WIN32_CE) #if defined(_WIN32_CE)
return ( GetKeyboardStatus() & KBDI_KEYBOARD_PRESENT ) ? 1 : 0; return ( GetKeyboardStatus() & KBDI_KEYBOARD_PRESENT ) ? 1 : 0;