error when entering main loop with no windows defined, as GLUT does
authorDiederick Niehorster <dcnieho@gmail.com>
Mon, 4 Mar 2013 16:27:00 +0000 (16:27 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Mon, 4 Mar 2013 16:27:00 +0000 (16:27 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1552 7f0cb862-5218-0410-a997-914c9d46530a

progs/demos/CallbackMaker/CallbackMaker.c
src/fg_main.c

index b6bb7dc..0d4dbb7 100644 (file)
@@ -227,6 +227,7 @@ Error(const char *fmt, va_list ap)
 
     /* print warning message */
     vprintf(fmt, ap);
+    printf("\n");
 
     /* terminate program, after pause for input so user can see */
     printf ( "Please enter something to exit: " );
index 885ed45..4c8bdd6 100644 (file)
@@ -414,6 +414,9 @@ void FGAPIENTRY glutMainLoop( void )
 
     FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutMainLoop" );
 
+    if (!fgStructure.Windows.First)
+        fgError(" ERROR:  glutMainLoop called with no windows created.");
+
        fgPlatformMainLoopPreliminaryWork ();
 
     fgState.ExecState = GLUT_EXEC_STATE_RUNNING ;