projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improving the stroke fonts per e-mail from Fliran Echtler dated Sun 5/31/2009 3:56 AM
[freeglut]
/
src
/
freeglut_init.c
diff --git
a/src/freeglut_init.c
b/src/freeglut_init.c
index
54297cf
..
9b4eb09
100644
(file)
--- a/
src/freeglut_init.c
+++ b/
src/freeglut_init.c
@@
-25,6
+25,7
@@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
+#define FREEGLUT_BUILDING_LIB
#include <GL/freeglut.h>
#include "freeglut_internal.h"
#include <GL/freeglut.h>
#include "freeglut_internal.h"
@@
-677,7
+678,8
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
char* geometry = NULL;
int i, j, argc = *pargc;
char* geometry = NULL;
int i, j, argc = *pargc;
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
size_t sLen;
errno_t err;
#endif
size_t sLen;
errno_t err;
#endif
@@
-701,7
+703,8
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
/* check if GLUT_FPS env var is set */
#ifndef _WIN32_WCE
{
/* check if GLUT_FPS env var is set */
#ifndef _WIN32_WCE
{
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
char* fps = NULL;
err = _dupenv_s( &fps, &sLen, "GLUT_FPS" );
if (err)
char* fps = NULL;
err = _dupenv_s( &fps, &sLen, "GLUT_FPS" );
if (err)
@@
-719,12
+722,14
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
else
fgState.FPSInterval = interval;
}
else
fgState.FPSInterval = interval;
}
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
free ( fps ); fps = NULL; /* dupenv_s allocates a string that we must free */
#endif
}
free ( fps ); fps = NULL; /* dupenv_s allocates a string that we must free */
#endif
}
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
err = _dupenv_s( &displayName, &sLen, "DISPLAY" );
if (err)
fgError("Error getting DISPLAY environment variable");
err = _dupenv_s( &displayName, &sLen, "DISPLAY" );
if (err)
fgError("Error getting DISPLAY environment variable");
@@
-815,7
+820,8
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
* variable for opening the X display (see code above):
*/
fghInitialize( displayName );
* variable for opening the X display (see code above):
*/
fghInitialize( displayName );
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
free ( displayName ); displayName = NULL; /* dupenv_s allocates a string that we must free */
#endif
free ( displayName ); displayName = NULL; /* dupenv_s allocates a string that we must free */
#endif
@@
-848,6
+854,16
@@
void FGAPIENTRY glutInit( int* pargc, char** argv )
}
}
}
}
+#ifdef _WIN32
+void (__cdecl *__glutExitFunc)( int retval ) = NULL;
+
+void FGAPIENTRY __glutInitWithExit( int *argcp, char **argv, void (__cdecl *exitfunc)(int) )
+{
+ __glutExitFunc = exitfunc;
+ glutInit(argcp, argv);
+}
+#endif
+
/*
* Undoes all the "glutInit" stuff
*/
/*
* Undoes all the "glutInit" stuff
*/
@@
-916,7
+932,8
@@
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
* delimited by blanks or tabs.
*/
char *token ;
* delimited by blanks or tabs.
*/
char *token ;
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
char *next_token = NULL;
#endif
size_t len = strlen ( displayMode );
char *next_token = NULL;
#endif
size_t len = strlen ( displayMode );
@@
-924,7
+941,8
@@
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
memcpy ( buffer, displayMode, len );
buffer[len] = '\0';
memcpy ( buffer, displayMode, len );
buffer[len] = '\0';
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
token = strtok_s ( buffer, " \t", &next_token );
#else
token = strtok ( buffer, " \t" );
token = strtok_s ( buffer, " \t", &next_token );
#else
token = strtok ( buffer, " \t" );
@@
-1105,7
+1123,8
@@
void FGAPIENTRY glutInitDisplayString( const char* displayMode )
break ;
}
break ;
}
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
+ /* will return true for VC8 (VC2005) and higher */
+#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
token = strtok_s ( NULL, " \t", &next_token );
#else
token = strtok ( NULL, " \t" );
token = strtok_s ( NULL, " \t", &next_token );
#else
token = strtok ( NULL, " \t" );