diff --git a/freeglut/web-src/docs/api.php b/freeglut/web-src/docs/api.php index bc1f769..f5811a9 100644 --- a/freeglut/web-src/docs/api.php +++ b/freeglut/web-src/docs/api.php @@ -66,6 +66,7 @@ will thus not work with the currently available 2.8.1 release.
+The glutInitErrorFunc and glutInitWarningFunc +functions specify callbacks that will be called upon warnings and errors +issued from within FreeGLUT so that the user can deal with these. +Useful for rerouting to another output sink (e.g., logging) and also to +avoid exit(1) being called upon error. As with other glutInit* +functions, these can be set before glutInit is called, so any output +from the library can be handled by the user. +
+ +Usage
+void glutInitErrorFunc ( void (* callback)( const char *fmt, va_list ap) );
+ void glutInitWarningFunc ( void (* callback)( const char *fmt, va_list ap) );
Description
+
+The users callback is passed a format string and a variable argument
+list that can be passed to functions such as printf.
+Note that there are the preprocessor definitions
+FREEGLUT_PRINT_ERRORS and FREEGLUT_PRINT_WARNINGS. If
+defined at library (not client app!) compile time, which is default,
+warnings and errors are printed to stderr. If not defined,
+warnings and errors are muted (not printed to stderr), though errors
+still trigger deinitialization and exit. Whether
+FREEGLUT_PRINT_ERRORS and FREEGLUT_PRINT_WARNINGS is
+defined does not affect whether the client callback is called, it only
+affects whether warnings and errors are printed to stderr when
+no callback is defined.
+
Changes From GLUT
+GLUT does not provide these functions.
+