Changes between Version 8 and Version 9 of GraphicsApi
- Timestamp:
- Oct 9, 2007, 3:46:10 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GraphicsApi
v8 v9 1 = Application graphics (version 6+)=1 = Application graphics = 2 2 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: 3 The recommended way to do application graphics 4 is with a separate 'graphics app' program having the properties that: 8 5 9 6 * If invoked with `--fullscreen`, it opens a full-screen borderless window, and must exit on mouse or keyboard input. … … 17 14 18 15 The BOINC graphics API (described below) provides cross-platform support for 19 developing graphics apps; 20 however, you need not use it. 16 developing graphics apps; however, you need not use it. 21 17 22 18 The logical name of the program must be 'graphics_app'. … … 25 21 graphics_app=uc2_graphics_5.10_windows_intelx86.exe 26 22 }}} 23 24 == Compatibility == 25 26 Let's call this the "new" way of doing graphics. 27 There is also an "old" way, in which graphics are generated by 28 a separate thread in the application process 29 (the old API is described [GraphicsApi here]). 30 31 Applications 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 27 40 28 41 == The BOINC Graphics API == … … 39 52 {{{ 40 53 void app_graphics_render(int xs, ys, double time_of_day); 54 }}} 55 56 This will be called periodically. 57 It 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 {{{ 41 61 void 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();46 62 }}} 47 These functions are described [GraphicsApi here]. 63 64 Called when the window size changes. 65 66 {{{ 67 void 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 74 void 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 80 void boinc_app_key_press( 81 int, int // system-specific key encodings 82 ) 83 84 void boinc_app_key_release( 85 int, int // system-specific key encodings 86 ) 87 }}} 48 88 49 89 == Communicating with the main application ==