Changes between Version 31 and Version 32 of GraphicsApi


Ignore:
Timestamp:
Aug 3, 2012, 5:44:26 PM (12 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GraphicsApi

    v31 v32  
    11[[PageOutline]]
    2 = Graphics in BOINC applications =
     2= Providing graphics for BOINC applications =
    33
    4 A BOINC application may produce graphics (e.g. visualizations) in two contexts:
     4A BOINC application may provide graphics (e.g. visualizations) to volunteers.
     5These graphics appear in two contexts:
    56
    6  * As a screensaver
     7 * As a screensaver.
    78 * In a window (opened using the Show Graphics button in the BOINC Manager).
    89
    9 Both types of graphics are produced using a 'graphics app' program
    10 (separate from your main application).
     10== Graphics apps ==
     11
     12The most general way of providing graphics involves
     13using a 'graphics app' program (separate from your main application).
    1114This graphics app must have the properties that:
    1215
     
    3841A complete example can be found in [ExampleApps boinc/samples/example_app].
    3942
    40 == The BOINC Graphics API == #api
     43=== The BOINC Graphics API === #api
    4144
    4245BOINC supplies a library (libboinc_graphics2.a) that makes it easy to develop graphics apps.
     
    9093}}}
    9194
    92 == Communicating with the main application ==
     95=== Communicating with the main application ===
    9396
    9497The graphics app may want to get information from the main app.
     
    128131doesn't see an inconsistent state.
    129132
    130 == Creating an icon for your applications ==
     133=== Creating an icon for your applications ===
    131134
    132135For Windows:
    133136
    134  *  make Icons (honestly I don't remember much about this - I vaguely remember there was a tool for this in Visual Studio), say "boincAppIcon16x16.ico", "boincAppIcon32x32.ico" and "boincAppIcon48x48.ico".
    135 
    136  * create a simple resource description file "boincAppIcon.rc" in the same directory as the icon files pointing to the icon filenames, the first entry is the resource name that is later passed to setWinIcon():
     137 *  make Icons (there's a tool for this in Visual Studio),
     138  say "boincAppIcon16x16.ico", "boincAppIcon32x32.ico" and "boincAppIcon48x48.ico".
     139 * create a simple resource description file "boincAppIcon.rc" in the same directory
     140  as the icon files pointing to the icon filenames,
     141  the first entry is the resource name that is later passed to setWinIcon():
    137142{{{
    138143boinca16 ICON boincAppIcon16x16.ico
     
    147152
    148153 * we call setWinIcon("boinca16","boinca48") in app_graphics_init()
     154
     155=== Support classes ===
     156
     157Several graphics-related classes were developed for SETI@home. They may be of general utility.
     158
     159`REDUCED_ARRAY`
     160    Represents a two-dimensional array of data, which is reduced to a smaller dimension by averaging or taking extrema. Includes member functions for drawing the reduced data as a 3D graph in several ways (lines, rectangles, connected surface).
     161`PROGRESS` and `PROGRESS_2D`
     162    Represent progress bars, depicted in 3 or 2 dimensions.
     163`RIBBON_GRAPH`
     164    Represents of 3D graph of a function of 1 variable.
     165`MOVING_TEXT_PANEL`
     166    Represents a flanged 3D panel, moving cyclically in 3 dimensions, on which text is displayed.
     167`STARFIELD`
     168    Represents a set of randomly-generated stars that move forwards or backwards in 3 dimensions.
     169`TEXTURE_DESC`
     170    Represents a JPEG image displayed in 3 dimensions.
     171
     172The file `api/txf_util.C` has support functions from drawing nice-looking 3D text.
     173
     174== Displaying a static image ==
     175
     176An application can display a pre-existing JPEG file as its graphic.
     177This is the simplest approach since you don't need to develop any code.
     178You must include the image file with each workunit.
     179To do this, link the application with `api/static_graphics.cpp` (edit this file to use your filename).
     180You can change the image over time,
     181but you must change the (physical, not logical) name of the file each time.
    149182
    150183== Using Web graphics ==