From 779ee206b75597e573b418540f88774528b63ebf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 21 Dec 2004 06:05:44 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4912 --- api/x_opengl.C | 38 ++++++++++++++++++++++---------------- checkin_notes | 7 +++++++ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/api/x_opengl.C b/api/x_opengl.C index e89d62f38a..9f03f2258e 100644 --- a/api/x_opengl.C +++ b/api/x_opengl.C @@ -86,15 +86,7 @@ static void close_func() { } static void make_new_window(int mode){ - char* args[] = {"foobar", 0}; - int one=1; - static bool first=true; - if (mode == MODE_WINDOW || mode == MODE_FULLSCREEN){ - if (first) { - glutInit(&one, args); - first = false; - } glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowPosition(xpos, ypos); glutInitWindowSize(600, 400); @@ -198,18 +190,32 @@ void restart() { } void xwin_graphics_event_loop() { + char* args[] = {"foobar", 0}; + int one=1; + static bool first=true; + graphics_thread = pthread_self(); - if (boinc_is_standalone()) { - set_mode(MODE_WINDOW); - } else { - wait_for_initial_message(); - timer_handler(0); - atexit(restart); + int restarted = setjmp(jbuf); + +#ifdef __APPLE_CC__ + first = true; +#endif + if (first) { + glutInit(&one, args); + first = false; } - int retval = setjmp(jbuf); - if (retval) { + + if (restarted) { //fprintf(stderr, "graphics thread restarted\n"); fflush(stderr); set_mode(MODE_HIDE_GRAPHICS); + } else { + if (boinc_is_standalone()) { + set_mode(MODE_WINDOW); + } else { + wait_for_initial_message(); + timer_handler(0); + atexit(restart); + } } glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0); glutMainLoop(); diff --git a/checkin_notes b/checkin_notes index f8e065db7e..3e522fcc15 100755 --- a/checkin_notes +++ b/checkin_notes @@ -21695,3 +21695,10 @@ David 20 Dec 2004 sched/ handle_request.C + +David 20 Dec 2004 + - app graphics: on Mac, reinit GLUT on each restart + Bruce: please test + + api/ + x_opengl.C