Table of Contents
This chapter alone comprises the bulk of information about application development. Each section outlines one area of interest for application developers. For example, there are sections that show how to get input from the system and others that show how to write applications for each of the currently supported graphics APIs. Please note that when writing an application, there will be overlap between these sections. For example, an application that needs input, sound, and OpenGL graphics will be based on concepts from each of the relevant sections.
Before getting into too much detail, we present this section as a review from earlier chapters. There is no new information here; it is simply a quick overview of the basics of VR Juggler applications.
As described in previous chapters (see Chapter 1, Getting Started, for example), all VR Juggler applications derive from a base application object class (vrj::App). This class defines the basic interface that VR Juggler expects from all application objects. This means that when constructing an application, the user-defined application object must inherit from vrj::App or from a Draw Manager-specific application class that has vrj::App as a superclass. For example:
class userApp : public vrj::App
{
public:
init();
preFrame();
postFrame();
}This defines a new application class (userApp), instances of which can be used anywhere that VR Juggler expects an application object.
A user application does not have to (and in most cases does not) derive from vrj::App directly. In almost all cases, an application class is derived from a Draw Manager-specific application class. For example:
class userGlApp : public vrj::GlApp
{
public:
init();
preFrame();
postFrame();
draw();
}This is an example of an OpenGL application. The application class (userGlApp) has derived directly from the OpenGL Draw Manager-specific vrj::GlApp application base class. This class provides extra definitions in the interface that are custom for OpenGL applications.