The Initialize, Draw, and Frame Routines

In GLUT

In GLUT, the initialize, draw, and frame routines are known as callbacks implemented with C function pointers. In VR juggler, the equivalent routines are called back using an application object. An application object is a C++ class that defines methods to encapsulate the functionality of the application within a single C++ object.

In VR Juggler

With VR Juggler, no C function pointers are necessary, but a pointer to an application object must be given to the VR Juggler kernel. As described in earlier sections of this chapter, the first step is to derive a new application class from vrj::GlApp. For more information on application objects, it may be helpful to review Chapter 2, Application Basics. Briefly, the application class definition would appear similar to the following:

class MyApplication : public vrj::GlApp
{
   ...
};

The draw, frame, and initialize routine concepts in VR Juggler are presented in the following list.

Readers who find some of these concepts unfamiliar are encouraged to read the section called “OpenGL Applications”. For information about context-specific data, refer to the section called “Context-Specific Data”.