To use Sh, some setup is required. First, you have to include the Sh header file. Assuming you have set up your include paths correctly, this is usually done as follows:
Before you can make any other Sh calls you have to initialize the library. This is done by calling the function shInit before making any other Sh calls.1 You can now use Sh for stream computing. If you want to use it for shaders, however, you will need two other calls. First, shBind will load a program into the shading unit given in the program’s definition. The shUpdate function should also be called after textures and uniform parameters have been modified but before rendering with the standard graphics API takes place. This will ensure that the Sh uniform parameters have been synchronized with the graphics API state.
Finally, you have to link your application to the libsh library, which can be used as a shared library.
Note: This manual is available as a bound book from AK Peters, including better formatting, in-depth examples, and about 200 pages not available on-line.