Finally, before we get to the source code, there are some important notes about programming VR Juggler applications in general. Please read these carefully and refer to the indicated chapters for more information as necessary.
Unlike the CAVElibs™ software, VR Juggler does not have to manage shared memory with other VR Juggler instances. Thus, when writing a VR Juggler application, memory can be created as in a normal, single-threaded C or C++ application.
As a result of the shared memory model described above, VR
Juggler has different requirements for context-specific data than
the CAVElibs™ software. Information such
as display lists and texture objects must be managed using
context-specific data. A display context is the
location to which OpenGL rendering commands draw. Compiled OpenGL
commands such as display lists do not get shared across multiple
contexts (or windows), and thus, they must be initialized once per
display context. In a VR Juggler application, these OpenGL
initializations must be placed in
vrj::GlApp::contextInit(). It is called
once per display context after each context has become active. For a
more detailed description of these concepts and a tutorial on how to
use them, please refer to the section called “Context-Specific Data”.