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_videoresize.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_display_mswin.c" />
<ClCompile Include="..\..\src\mswin\freeglut_ext_mswin.c" />
@ -368,6 +369,7 @@
<ClInclude Include="..\..\include\GL\freeglut_std.h" />
<ClInclude Include="..\..\src\Common\freeglut_teapot_data.h" />
<ClInclude Include="..\..\include\GL\glut.h" />
<ClInclude Include="..\..\src\Common\xparsegeometry_repl.h" />
<ClInclude Include="..\..\src\mswin\freeglut_internal_mswin.h" />
</ItemGroup>
<ItemGroup>

View File

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

View File

@ -315,9 +315,8 @@ void fgDeinitialize( void )
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
#if !TARGET_HOST_POSIX_X11
#include "Common/xparsegeometry_repl.h"
# include "../Common/xparsegeometry_repl.h"
#endif
/*
@ -499,7 +498,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
configuration is conformant or not */
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! */
break ;
@ -619,8 +618,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode )
break ;
case 35 : /* "borderless": windows should not have borders */
#if TARGET_HOST_POSIX_X11
#endif
glut_state_flag |= GLUT_BORDERLESS;
break ;
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 )
{
/* 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.MinorVersion = minorVersion;
}
@ -684,4 +682,4 @@ void FGAPIENTRY glutInitWarningFunc( void (* vfgWarning) ( const char *fmt, va_l
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_VAL(a,v) {ATTRIB(a); ATTRIB(v);}
extern int fghIsLegacyContextVersionRequested( void );
extern int fghMapBit( int mask, int from, int to );
extern int fghIsLegacyContextRequested( void );
extern void fghContextCreationError( void );
extern int fghNumberOfAuxBuffersRequested( void );
int fghIsLegacyContextVersionRequested( void );
int fghMapBit( int mask, int from, int to );
int fghIsLegacyContextRequested( void );
void fghContextCreationError( void );
int fghNumberOfAuxBuffersRequested( void );
#endif /* FREEGLUT_INTERNAL_H */

View File

@ -47,14 +47,11 @@
* glutCreateSubWindow() -- Check when default position and size is {-1,-1}
* glutDestroyWindow() -- check the Win32 version
* glutSetWindow() -- check the Win32 version
* glutGetWindow() -- OK
* glutSetWindowTitle() -- check the Win32 version
* glutSetIconTitle() -- check the Win32 version
* glutShowWindow() -- check the Win32 version
* glutHideWindow() -- check the Win32 version
* glutIconifyWindow() -- check the Win32 version
* glutReshapeWindow() -- check the Win32 version
* glutPositionWindow() -- check the Win32 version
* glutPushWindow() -- 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 )
{

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, height, xoffset, and yoffset are unsigned integers.
* Example: "=80x24+300-49"

View File

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

View File

@ -121,9 +121,10 @@ void fgPlatformInitialize( const char* displayName )
fgState.Initialised = GL_TRUE;
/* Avoid registering atexit callback on Win32 as it results in an access
* violation due to calling into a module which has been unloaded.
* Any cleanup isn't needed on Windows anyway, the OS takes care of it.c
/* Avoid registering atexit callback on Win32 as it can result in an
* access violation due to calling into a module which has been
* 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
*/
/* atexit(fgDeinitialize); */

View File

@ -69,8 +69,8 @@ LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay;
struct tagSFG_PlatformDisplay
{
HINSTANCE Instance; /* The application's instance */
DEVMODE DisplayMode; /* Desktop's display settings */
HINSTANCE Instance; /* The application's instance */
DEVMODE DisplayMode; /* Desktop's display settings */
char *DisplayName; /* Display name for multi display support*/
};
@ -83,7 +83,7 @@ typedef HGLRC SFG_WindowContextType;
typedef struct tagSFG_PlatformContext SFG_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;
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 */
};
/* 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 */
#if !defined(_WIN32_WCE)
# 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,
* 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)
return ( GetKeyboardStatus() & KBDI_KEYBOARD_PRESENT ) ? 1 : 0;