X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_callbacks.c;h=da06283cd91cc101d519677ce2a4eaaf8c9024e1;hb=c098c349121295f7ce55563cabc88e68c985fd99;hp=b741a0c19a53e0db21c9f2a32f47bd72891b26ce;hpb=646676b8dbf8ab504ac8a275fe9a63a403a3190b;p=freeglut diff --git a/src/freeglut_callbacks.c b/src/freeglut_callbacks.c index b741a0c..da06283 100644 --- a/src/freeglut_callbacks.c +++ b/src/freeglut_callbacks.c @@ -48,7 +48,16 @@ */ void FGAPIENTRY glutDisplayFunc( void (* callback)( void ) ) { + if( !callback ) + fgError ("Fatal error in program. NULL display callback not " + "permitted in GLUT 3.0+ or freeglut 2.0.1+\n"); SET_CALLBACK( Display ); + + /* + * Force a redisplay with the new callback + */ + fgStructure.Window->State.Redisplay = TRUE; + } /* @@ -100,7 +109,7 @@ void FGAPIENTRY glutTimerFunc( unsigned int timeOut, void (* callback)( int ), i /* * Create a new freeglut timer hook structure */ - timer = calloc( sizeof(SFG_Timer), 1 ); + timer = (SFG_Timer *)calloc( sizeof(SFG_Timer), 1 ); /* * Remember the callback address and timer hook's ID