pfmpkImport(3pf) OpenGL Performer 3.2.2 libpfmpk Reference Pages
NAME
pfMPKImportFile, pfMPKImportConfig, pfMPKPreConfig, pfMPKPostConfig,
pfMPKPostDMConfig - Import OpenGL Multipipe SDK configuration files.
FUNCTION SPECIFICATION
#include <Performer/pf.h>
#include <Performer/pfmpk/pfmpk.h>
void pfMPKImportFile(char *filename);
void pfMPKImportConfig(MPKConfig *cfg);
void pfMPKPreConfig(MPKConfig *cfg, pfMPKImportInfo *info);
void pfMPKPostConfig(MPKConfig *cfg, pfMPKImportInfo *info);
void pfMPKPostDMConfig(MPKConfig *cfg, pfMPKImportInfo *info);
typedef struct
{
int x_size, y_size;
} pfMPKImportPipeInfo;
typedef struct
{
int numPipes;
pfMPKImportPipeInfo *pipeInfo;
} pfMPKImportInfo;
DESCRIPTION
This man page describes a set of functions for reading display
configuration files from the OpenGL Multipipe SDK toolkit into OpenGL
Performer. OpenGL Multipipe SDK configuration files describe the layout
of pipes, windows and channels of an application. This layout includes
the hierarchy and frustum specification of these pipes/channels/windows.
The functions described below provide two methods for configuring a
Performer application using a Multipipe SDK configuration file: A simple
high-level method hiding most of the complexity, and a lower-level method
providing more application flexibility.
pfMPKImportFile takes a Multipipe SDK filename and generates Performer
objects (pfPipe, pfPipeWindow, pfChannel) accordingly. pfMPKImportConfig
is very similar. Instead of accepting a filename, it accepts a Multipipe
SDK configuration class MPKConfig. The result of these functions is two-
fold:
Page 1
pfmpkImport(3pf) OpenGL Performer 3.2.2 libpfmpk Reference Pages
(1) Performer is configured with pipes/windows/channels as
defined by the MultipipeSDK configuration file.
(2) pfvDisplayMngr contains a description of the configured display
topology (what pipe has what windows and what channels). It also
contains pointers to all the newly generated Performer classes
(pfPipe, pfPipeWindow, pfChannel).
Here is a code sample for using pfMPKImportFile:
// Initialize Performer
pfInit();
// Initialize the MultipipeSDK import library.
pfmpkInit();
// Import a MultipipeSDK file. This function calls pfConfig
// so we don't have to.
pfMPKImportFile(config_filename);
pfNode *root = pfdLoadFile(model_filename);
// Attach loaded file to a new pfScene
pfScene *scene = new pfScene;
scene->addChild(root);
// Create a pfLightSource and attach it to scene
scene->addChild(new pfLightSource);
// Get access to the results of the MultipipeSDK import.
// pfvDisplayMngr contains pointers to all the
// pipes/windows/channels that the MultipipeSDK file specified.
pfvDisplayMngr *dm = pfvDisplayMngr::getMngr();
// All configured channels share the scene graph so we only
// have to assign one channel.
pfChannel *chan = dm -> getChan(0) -> getHandle();
chan->setScene(scene);
Both pfMPKImportFile and pfMPKImportConfig encapsulate the entire
Performer configuration stage including the call to pfConfig. This may
be too inflexible for some applications. An additional set of functions
provides lower-level access.
All the MultipipeSDK import functions discussed in this man page use the
pfvDisplayMngr class for maintaining the Performer configuration
topology. The following code sample shows the internal structure of
pfMPKImportConfig. All the calls that pfMPKImportConfig makes are
publicly accessible and an application can call them directly.
Page 2
pfmpkImport(3pf) OpenGL Performer 3.2.2 libpfmpk Reference Pages
void pfMPKImportConfig(MPKConfig *cfg)
{
pfvDisplayMngr *dm = pfvDisplayMngr::getMngr();
pfMPKImportInfo info;
// Prepare temporary storage for pipe information.
info . numPipes = mpkConfigNPipes(cfg);
info . pipeInfo = (pfMPKImportPipeInfo *)
malloc (info.numPipes * sizeof (pfMPKImportPipeInfo));
// Translate contents of MPKConfig into pfvDisplayMngr terms.
pfMPKPreConfig(cfg, &info);
// Let pfvDisplayMngr run all its pre-pfConfig processing.
dm -> preConfig();
// Performer configuration: After this point, we can start
// creating Performer windows and channels.
pfConfig();
// Inquire pipe sizes, and configure all pfvDisplayMngr
// objects that depend on them.
pfMPKPostConfig(cfg, &info);
// Ask pfDisplayMngr to create all the windows/channels.
dm -> postConfig();
// Invoke any pfPipe/pfPipeWindow/pfChannel calls that
// pfDisplayMngr doesn't encapsulate.
pfMPKPostDMConfig(cfg, &info);
}
void pfMPKImportFile(char *filename)
{
pfMPKImportConfig(mpkConfigLoad(filename));
}
pfMPKPreConfig traverses the MPKConfig class and creates its
pfDisplatMngr equivalent. pfMPKPostConfig patches the previous
pfDisplayMngr configuration using pipe size information. This information
becomes available after the call to pfConfig so patching can not happen
in pfMPKPreConfig.
Page 3
pfmpkImport(3pf) OpenGL Performer 3.2.2 libpfmpk Reference Pages
pfMPKPostDMConfig traverses the pfvDisplayMngr hierarchy one last time.
This time, pfvDisplayMngr already contains valid pointers to the
Performer classes it created. pfMPKPostDMConfig makes Performer calls on
the pfPipe, pfPipeWindow and pfChannel pointers. Since pfvDisplayMngr
doesn't encapsulate all configuration details, pfMPKPostDMConfig makes
these configuration calls directly on the new Performer classes.
The lower level calls described above were made public because they
enable access to the pfvDisplayMngr hierarchy before the call to
pfConfig.
SEE ALSO
pfvDisplayMngr, MPKConfig
Page 4