Changes between Version 8 and Version 9 of GraphicsApi


Ignore:
Timestamp:
Oct 9, 2007, 3:46:10 PM (17 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GraphicsApi

    v8 v9  
    1 = Application graphics (version 6+) =
     1= Application graphics =
    22
    3 [[T(VersionSix)]]
    4 
    5 Starting with BOINC version 6.0,
    6 application graphics are generated by a separate 'graphics app' program.
    7 The only constraints on a graphics app are:
     3The recommended way to do application graphics
     4is with a separate 'graphics app' program having the properties that:
    85
    96 * If invoked with `--fullscreen`, it opens a full-screen borderless window, and must exit on mouse or keyboard input.
     
    1714
    1815The BOINC graphics API (described below) provides cross-platform support for
    19 developing graphics apps;
    20 however, you need not use it.
     16developing graphics apps; however, you need not use it.
    2117
    2218The logical name of the program must be 'graphics_app'.
     
    2521graphics_app=uc2_graphics_5.10_windows_intelx86.exe
    2622}}}
     23
     24== Compatibility ==
     25
     26Let's call this the "new" way of doing graphics.
     27There is also an "old" way, in which graphics are generated by
     28a separate thread in the application process
     29(the old API is described [GraphicsApi here]).
     30
     31Applications types interact with client software versions as follows:
     32
     33 || || old apps || new apps ||
     34 || client version 5 || * || * ||
     35 || client version 6+ || * || ** ||
     36
     37* graphics work except on Vista with service-mode install
     38
     39** graphics work in all situations
    2740
    2841== The BOINC Graphics API ==
     
    3952{{{
    4053void app_graphics_render(int xs, ys, double time_of_day);
     54}}}
     55
     56This will be called periodically.
     57It should generate the current graphic.
     58`xs` and `ys` are the X and Y sizes of the window, and `time_of_day` is the relative time in seconds.
     59
     60{{{
    4161void app_graphics_resize(int x, int y);
    42 void boinc_app_mouse_move();
    43 void boinc_app_mouse_button();
    44 void boinc_app_key_press();
    45 void boinc_app_key_release();
    4662}}}
    47 These functions are described [GraphicsApi here].
     63
     64Called when the window size changes.
     65
     66{{{
     67void boinc_app_mouse_move(
     68    int x, int y,       // new coords of cursor
     69    int left,          // whether left mouse button is down
     70    int middle,
     71    int right
     72);
     73
     74void boinc_app_mouse_button(
     75    int x, int y,       // coords of cursor
     76    int which,          // which button (0/1/2)
     77    int is_down        // true iff button is now down
     78);
     79
     80void boinc_app_key_press(
     81    int, int            // system-specific key encodings
     82)
     83
     84void boinc_app_key_release(
     85    int, int            // system-specific key encodings
     86)
     87}}}
    4888
    4989== Communicating with the main application ==