messages. Please test. (Modified glutInit(), the state structure,
and the warn/err functions.)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@238
7f0cb862-5218-0410-a997-
914c9d46530a
char* displayName = NULL;
int i, j, argc = *pargc;
+ if (pargc && *pargc && argv && *argv && **argv)
+ fgState.ProgramName = strdup (*argv);
+ else
+ fgState.ProgramName = strdup ("");
/*
* Do not allow multiple initialization of the library
*/
int GameModeDepth; /* The pixel depth for game mode */
int GameModeRefresh; /* The refresh rate for game mode */
- int ActionOnWindowClose ; /* Action when user clicks "x" on window header bar */
-
- fgExecutionState ExecState ; /* Current state of the GLUT execution */
+ int ActionOnWindowClose; /* Action when user clicks "x" on window header bar */
+ fgExecutionState ExecState; /* Current state of the GLUT execution */
+ char *ProgramName;
};
/*
va_start( ap, fmt );
- fprintf( stderr, "freeglut: ");
+ fprintf( stderr, "freeglut (%s): ", fgState.ProgramName || "");
vfprintf( stderr, fmt, ap );
fprintf( stderr, "\n" );
va_start( ap, fmt );
- fprintf( stderr, "freeglut: ");
+ fprintf( stderr, "freeglut (%s): ", fgState.ProgramName || "");
vfprintf( stderr, fmt, ap );
fprintf( stderr, "\n" );