Changes between Version 7 and Version 8 of GraphicsApi


Ignore:
Timestamp:
Oct 4, 2007, 4:25:20 PM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GraphicsApi

    v7 v8  
    44
    55Starting with BOINC version 6.0,
    6 applications graphics are generated by a separate program.
    7 The only constraints on this program are:
     6application graphics are generated by a separate 'graphics app' program.
     7The only constraints on a graphics app are:
    88
    9  * If invoked with `--fullscreen`, it opens a full-screen borderless window, and must exit when mouse or keyboard input occurs.
    10  * If not invoked with `--fullscreen`, it opens a standard window, and it may handle mouse/keyboard input.
     9 * If invoked with `--fullscreen`, it opens a full-screen borderless window, and must exit on mouse or keyboard input.
     10 * Otherwise it opens a standard window, and may handle mouse/keyboard input.
    1111
    1212The graphics app is launched by the BOINC Manager and by the screensaver.
     
    1717
    1818The BOINC graphics API (described below) provides cross-platform support for
    19 developing such a program;
     19developing graphics apps;
    2020however, you need not use it.
    2121
    22 The logical name of the program must be 'v6graphics'.
     22The logical name of the program must be 'graphics_app'.
    2323When you set up your application version directory, give it a filename like
    2424{{{
    25 v6graphics=uc2_graphics_5.10_windows_intelx86.exe
     25graphics_app=uc2_graphics_5.10_windows_intelx86.exe
    2626}}}
    2727
     
    4949== Communicating with the main application ==
    5050
    51 Typically the graphics app will want to get information from the main app.
     51The graphics app may want to get information from the main app.
    5252This can be done efficiently using shared memory.
    5353The BOINC library supplies the following functions to facilitate this:
     
    5656void* boinc_graphics_get_shmem(char* appname);
    5757}}}
    58 `boinc_graphics_make_shmem()` (called from the main app) creates a shared memory segment of the given size.  'appname' should be the name of this application (used to ensure uniqueness of the shared-memory segment name). `boinc_graphics_get_shmem()` (called from the graphics app) attaches to an existing segment.
     58`boinc_graphics_make_shmem()` (called from the main app) creates a shared memory segment of the given size.
     59'appname' should be the name of this application (used to ensure uniqueness of the shared-memory segment name). `boinc_graphics_get_shmem()` (called from the graphics app) attaches to an existing segment.
    5960
    6061The contents of the shared memory segment are up to you.
     
    6970}}}
    7071
    71  update_time:: The time of day when this structure was last modified.  This can be used to implement a 'heartbeat' mechanism so that the graphics app will exit if the main app dies.
     72This structure should be updated by the main app once per second,
     73using [BasicApi#Registeringatimerhandler boinc_set_timer_handler()].
     74The items are:
     75 update_time:: The current time (dtime()).  The graphics app should exit if the current time exceeds this by 5 seconds or so.
    7276 fraction_done:: The last fraction done reported by the main app.
    73  cpu_time:: The last CPU time reported by the main app.
     77 cpu_time:: The current CPU time.
    7478 status:: The BOINC status.  If the 'suspended' flag is set, the graphics app should stop changing its display, and simply display an "application suspended" message.
    7579
    76 You may want to use a semaphore to synchronize access to the shared memory.
    7780Keep in mind that multiple instances of the graphics app may run simultaneously;
    7881avoid having the graphics app write to the shared memory.
     82If you use shared memory to store a data structure,
     83use a semaphore to synchronize access so that the graphics app
     84doesn't see an inconsistent state.