error when entering main loop with no windows defined, as GLUT does

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1552 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2013-03-04 16:27:00 +00:00
parent 9fa8bcf4db
commit 7365dc38d4
2 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,7 @@ Error(const char *fmt, va_list ap)
/* print warning message */ /* print warning message */
vprintf(fmt, ap); vprintf(fmt, ap);
printf("\n");
/* terminate program, after pause for input so user can see */ /* terminate program, after pause for input so user can see */
printf ( "Please enter something to exit: " ); printf ( "Please enter something to exit: " );

View File

@ -414,6 +414,9 @@ void FGAPIENTRY glutMainLoop( void )
FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoop" ); FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoop" );
if (!fgStructure.Windows.First)
fgError(" ERROR: glutMainLoop called with no windows created.");
fgPlatformMainLoopPreliminaryWork (); fgPlatformMainLoopPreliminaryWork ();
fgState.ExecState = GLUT_EXEC_STATE_RUNNING ; fgState.ExecState = GLUT_EXEC_STATE_RUNNING ;