X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FCallbackMaker%2FCallbackMaker.c;h=9c0d58b38bcbcf540fc4dae42a6d150dd4e3cb39;hb=775071fb9c0eee0bf4b5b13a38a12176518da055;hp=6c8730dd31e367f1ef75b478499c15df036b0537;hpb=1bc8c778760ebbba826f2795a0f30e1ef2d47ec8;p=freeglut diff --git a/progs/demos/CallbackMaker/CallbackMaker.c b/progs/demos/CallbackMaker/CallbackMaker.c index 6c8730d..9c0d58b 100644 --- a/progs/demos/CallbackMaker/CallbackMaker.c +++ b/progs/demos/CallbackMaker/CallbackMaker.c @@ -65,7 +65,7 @@ Display(void) glPushMatrix (); glLoadIdentity (); glColor3ub ( 0, 0, 0 ); - glRasterPos2i ( 10, glutGet ( GLUT_WINDOW_HEIGHT ) - 10 ); + glRasterPos2i ( 10, glutGet ( GLUT_WINDOW_HEIGHT ) - 20 ); /* 10pt margin above 10pt letters */ if ( reshape_called ) { @@ -151,18 +151,13 @@ Error(const char *fmt, va_list ap) /* print warning message */ vprintf(fmt, ap); - /* deInitialize the freeglut state */ - /* This all goes haywire of course when the error occurs during deinitialize, - * one might want to call exit directly as its possible freeglut is messed - * up internally when error is called. - */ - printf("Error callback: calling glutExit() to prepare for clean exit\n"); - glutExit(); - - /* terminate program */ + /* terminate program, after pause for input so user can see */ printf ( "Please enter something to exit: " ); fgets ( dummy_string, STRING_LENGTH, stdin ); + /* Call exit directly as freeglut is messed + * up internally when an error is called. + */ exit(1); } @@ -176,6 +171,7 @@ Reshape(int width, int height) reshape_width = width ; reshape_height = height ; reshape_seq = sequence_number ; + glViewport(0,0,width,height); glutPostRedisplay () ; }