VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Creating a Plug-In

A typical VR-Vantage application (such as VR-Vantage) creates a DtDe, then immediately creates a DtPluginManager (DtPluginManager.h) - a class responsible for loading and initializing plug-ins.

The Plug-in Manager loads plug-ins before DtDe::initialize() is even called, because a plug-in developer often wants to affect the way a DtDe is initialized. The DtPluginManager loads each of the plug-ins in the ./plugins folder, and tries to call a global function called initDeModule(). The Plug-in Manager passes a pointer to the DtDe to initDeModule(), so that the plug-in has access to the DtDe. Therefore, the main responsibility of every plug-in developer is to implement and export (with C linkage) a global function called initDeModule().

What you actually do in your plug-in is up to you. A typical plug-in may subclass one of the key VR-Vantage classes and register the subclass with the display engine within initDeModule(). For example, the following plug-in code registers a new subclass of DtChannel (DtChannel.h) (the class that represents visual channels) with the display engine:

// This method is called by the DtPluginManager during startup.
{
// Tell the display engine to use an instance of MyChannelCreator
// instead of the base DtChannelCreator to create channels.
// MyChannelCreator will create MyChannels instead of base
// DtChannels.
DtChannelCreator::registerInstance(de, new MyChannelCreator);
}

Once you build your plug-in, place it in the ./plugins folder, so that DtPluginManager can find it.


Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)