diff --git a/checkin_notes b/checkin_notes index 1fd8b5a80c..3172cf2a96 100644 --- a/checkin_notes +++ b/checkin_notes @@ -481,3 +481,10 @@ David 26 Sept 2007 example_app/ uc2.C + +David 26 Sept 2007 + - minor stuff + + example_app + uc2.C + uc2_graphics.C diff --git a/example_app/uc2.C b/example_app/uc2.C index c7307fe92f..bab76119de 100755 --- a/example_app/uc2.C +++ b/example_app/uc2.C @@ -55,6 +55,8 @@ #include "mfile.h" #include "graphics2.h" +#define APP_GRAPHICS + #ifdef APP_GRAPHICS #include "uc2.h" UC_SHMEM* shmem; @@ -179,6 +181,10 @@ int main(int argc, char **argv) { // create shared mem segment for graphics, and arrange to update it // shmem = (UC_SHMEM*)boinc_graphics_make_shmem("uppercase", sizeof(UC_SHMEM)); + if (!shmem) { + fprintf(stderr, "failed to create shared mem segment\n"); + } + update_shmem(); boinc_register_timer_callback(update_shmem); #endif diff --git a/example_app/uc2_graphics.C b/example_app/uc2_graphics.C index b3876ac226..a55048ffdb 100644 --- a/example_app/uc2_graphics.C +++ b/example_app/uc2_graphics.C @@ -152,8 +152,10 @@ void app_graphics_render(int xs, int ys, double time_of_day) { // boinc_parse_init_data_file() // Put this in the main loop to allow retries if the // worker application has not yet created shared memory - if (shmem == NULL) + // + if (shmem == NULL) { shmem = (UC_SHMEM*)boinc_graphics_get_shmem("uppercase"); + } glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -258,7 +260,7 @@ int main(int argc, char** argv) { #endif boinc_parse_init_data_file(); boinc_get_init_data(uc_aid); - if (uc_aid.project_preferences) { + if (uc_aid.project_preferences) { parse_project_prefs(uc_aid.project_preferences); } boinc_graphics_loop(argc, argv);