Changes between Version 2 and Version 3 of GraphicsApiOld


Ignore:
Timestamp:
Apr 23, 2007, 4:59:15 PM (17 years ago)
Author:
Nicolas
Comment:

Formatting changes (monospaced filenames and function names)

Legend:

Unmodified
Added
Removed
Modified
  • GraphicsApiOld

    v2 v3  
    88== Integrated graphics ==
    99
    10 Graphics can either be integrated in your main application or generated by a separate program. The integrated approach is recommended, and we'll describe it first. In this approach, instead of boinc_init(), an application calls
     10Graphics can either be integrated in your main application or generated by a separate program. The integrated approach is recommended, and we'll describe it first. In this approach, instead of `boinc_init()`, an application calls
    1111
    1212{{{
     
    2424On Unix, your graphics code must be put in a separate shared library (.so) file. This is because Unix hosts may not have the needed libraries (OpenGL, GLUT, X11). If an application is linked dynamically to these libraries, it will fail on startup if the libraries are not present. On the other hand, if an application is linked statically to these libraries, graphics will be done very inefficiently on most hosts.
    2525
    26 The shared library must have the same name as the executable followed by '.so'. It must be linked with libboinc_graphics_impl.a, with your rendering and input-handling functions, and (dynamically) with glut and opengl. You must bundle the main program and the shared library together as a [http://boinc.berkeley.edu/tool_update_versions.php multi-file application version]. Unix/Linux applications that use graphics should compile all files with -D_REENTRANT, since graphics uses multiple threads.
     26The shared library must have the same name as the executable followed by '.so'. It must be linked with `libboinc_graphics_impl.a`, with your rendering and input-handling functions, and (dynamically) with glut and opengl. You must bundle the main program and the shared library together as a [http://boinc.berkeley.edu/tool_update_versions.php multi-file application version]. Unix/Linux applications that use graphics should compile all files with `-D_REENTRANT`, since graphics uses multiple threads.
    2727
    2828The [http://boinc.berkeley.edu/example.php BOINC example application] uses this technique, and shows the Makefile command that are needed to produce the shared library on Unix.
     
    100100Several graphics-related classes were developed for SETI@home. They may be of general utility.
    101101
    102 REDUCED_ARRAY
     102`REDUCED_ARRAY`
    103103    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).
    104 PROGRESS and PROGRESS_2D
     104`PROGRESS` and `PROGRESS_2D`
    105105    Represent progress bars, depicted in 3 or 2 dimensions.
    106 RIBBON_GRAPH
     106`RIBBON_GRAPH`
    107107    Represents of 3D graph of a function of 1 variable.
    108 MOVING_TEXT_PANEL
    109     Represents a flanged 3D panel, moving cyclically in 3 dimentions, on which text is displayed.
    110 STARFIELD
     108`MOVING_TEXT_PANEL`
     109    Represents a flanged 3D panel, moving cyclically in 3 dimensions, on which text is displayed.
     110`STARFIELD`
    111111    Represents a set of randomly-generated stars that move forwards or backwards in 3 dimensions.
    112 TEXTURE_DESC
    113     Represents an image (JPEG, Targa, BMP, PNG, or RGB ) displayed in 3 dimensions.
     112`TEXTURE_DESC`
     113    Represents an image (JPEG, Targa, BMP, PNG, or RGB``) displayed in 3 dimensions.
    114114
    115 The file api/txf_util.C has support functions from drawing nice-looking 3D text.
     115The file `api/txf_util.C` has support functions from drawing nice-looking 3D text.
    116116
    117117= Static graphics =
    118118
    119 An application can display a pre-existing image file (JPEG, GIFF, BMP or Targa) as its graphic. This is the simplest approach since you don't need to develop any code. You must include the image file with each workunit. To do this, link the application with api/static_graphics.C (edit this file to use your filename). You can change the image over time, but you must change the (physical, not logical) name of the file each time.
     119An application can display a pre-existing image file (JPEG, GIFF, BMP or Targa) as its graphic. This is the simplest approach since you don't need to develop any code. You must include the image file with each workunit. To do this, link the application with `api/static_graphics.C` (edit this file to use your filename). You can change the image over time, but you must change the (physical, not logical) name of the file each time.
    120120
    121121= Graphics in a separate program =
    122122
    123 In this approach, an application bundles a 'main program' and a 'graphics program'. The main program executes the graphics program, and kills it when done. The main and graphics programs typically communicate using shared memory; you can use the functions in boinc/lib/shmem.C for this.
     123In this approach, an application bundles a 'main program' and a 'graphics program'. The main program executes the graphics program, and kills it when done. The main and graphics programs typically communicate using shared memory; you can use the functions in `boinc/lib/shmem.C` for this.
    124124
    125125The main program should initialize using