X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=2cc19ea612854121907698cdfe625775649c5f60;hb=ed763e2ce311f7cffc144bd93617c8978b84870c;hp=7cccc3552ab5191040ccb67ba26104520e8ca51c;hpb=e951e2cfe0617bda21fed114494095137925ff6e;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 7cccc35..2cc19ea 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -89,9 +89,11 @@ SFG_State fgState = { { -1, -1, GL_FALSE }, /* Position */ 1, /* AuxiliaryBufferNumber */ 4, /* SampleNumber */ 1, /* MajorVersion */ - 0, /* MajorVersion */ + 0, /* MinorVersion */ 0, /* ContextFlags */ - 0 /* ContextProfile */ + 0, /* ContextProfile */ + NULL, /* ErrorFunc */ + NULL /* WarningFunc */ }; @@ -1143,4 +1145,24 @@ void FGAPIENTRY glutInitContextProfile( int profile ) fgState.ContextProfile = profile; } +/* -------------- User Defined Error/Warning Handler Support -------------- */ + +/* + * Sets the user error handler (note the use of va_list for the args to the fmt) + */ +void FGAPIENTRY glutInitErrorFunc( void (* vfgError) ( const char *fmt, va_list ap ) ) +{ + /* This allows user programs to handle freeglut errors */ + fgState.ErrorFunc = vfgError; +} + +/* + * Sets the user warning handler (note the use of va_list for the args to the fmt) + */ +void FGAPIENTRY glutInitWarningFunc( void (* vfgWarning) ( const char *fmt, va_list ap ) ) +{ + /* This allows user programs to handle freeglut warnings */ + fgState.ErrorFunc = vfgWarning; +} + /*** END OF FILE ***/