pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NAME
pfNewPWin, pfGetPWinClassType, pfPWinAspect, pfPWinConfigFunc,
pfPWinFBConfig, pfPWinFBConfigAttrs, pfPWinFBConfigData,
pfPWinFBConfigId, pfPWinFullScreen, pfPWinGLCxt, pfPWinIndex, pfPWinList,
pfPWinMode, pfPWinName, pfPWinOrigin, pfPWinOriginSize, pfPWinOverlayWin,
pfPWinScreen, pfPWinShare, pfPWinSize, pfPWinStatsWin, pfPWinType,
pfPWinWSConnectionName, pfPWinWSDrawable, pfPWinWSWindow,
pfGetPWinAspect, pfGetPWinChanIndex, pfGetPWinConfigFunc,
pfGetPWinCurOriginSize, pfGetPWinCurScreenOriginSize, pfGetPWinCurState,
pfGetPWinCurWSDrawable, pfGetPWinFBConfig, pfGetPWinFBConfigAttrs,
pfGetPWinFBConfigData, pfGetPWinFBConfigId, pfGetPWinGLCxt,
pfGetPWinIndex, pfGetPWinList, pfGetPWinMode, pfGetPWinName,
pfGetPWinOrigin, pfGetPWinOverlayWin, pfGetPWinPipe, pfGetPWinPipeIndex,
pfGetPWinPosPVChan, pfGetPWinScreen, pfGetPWinScreenOrigin,
pfGetPWinSelect, pfGetPWinShare, pfGetPWinSize, pfGetPWinStatsWin,
pfGetPWinType, pfGetPWinWSConnectionName, pfGetPWinWSDrawable,
pfGetPWinWSWindow, pfPWinPVChan, pfPWinAddPVChan, pfPWinRemovePVChan,
pfPWinRemovePVChanIndex, pfGetPWinNumPVChans, pfGetPWinPVChan,
pfGetPWinPVChanId, pfGetPWinPVChanIndex, pfBindPWinPVChans,
pfUnbindPWinPVChans, pfAttachPWin, pfAttachPWinWin, pfClosePWin,
pfClosePWinGL, pfConfigPWin, pfOpenPWin, pfIsPWinOpen, pfIsManagedPWin,
pfMQueryPWin, pfQueryPWin, pfChoosePWinFBConfig, pfSelectPWin,
pfAttachPWinSwapGroup, pfAttachPWinWinSwapGroup, pfPWinInSwapGroup,
pfPWinSwapBarrier, pfGetPWinSwapBarrier, pfSwapPWinBuffers,
pfGetNumChans, pfAddChan, pfGetChan, pfInsertChan, pfMoveChan,
pfRemoveChan, pfInitGfx - Initialize and manipulate pfPipeWindows within
a pfPipe
FUNCTION SPECIFICATION
#include <Performer/pf.h>
pfPipeWindow* pfNewPWin(pfPipe *p);
pfType* pfGetPWinClassType(void);
void pfPWinAspect(pfPipeWindow *pwin, int x, int y);
void pfPWinConfigFunc(pfPipeWindow *pwin,
pfPWinFuncType func);
void pfPWinFBConfig(pfPipeWindow *pwin,
XVisualInfo *vi);
void pfPWinFBConfigAttrs(pfPipeWindow *pwin, int *attr);
void pfPWinFBConfigData(pfPipeWindow *pwin, void *data);
void pfPWinFBConfigId(pfWindow *win, int id);
void pfPWinFullScreen(pfPipeWindow *pwin);
Page 1
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
void pfPWinGLCxt(pfPipeWindow *pwin, pfGLContext gc);
void pfPWinIndex(pfPipeWindow *pwin, int index);
void pfPWinList(pfPipeWindow *pwin, pfList *wlist);
void pfPWinMode(pfPipeWindow *pwin, int mode, int val);
void pfPWinName(pfPipeWindow *pwin, const char *name);
void pfPWinOrigin(pfPipeWindow *pwin, int xo, int yo);
void pfPWinOriginSize(pfPipeWindow *pwin, int xo,
int yo, int xs, int ys);
void pfPWinOverlayWin(pfPipeWindow *pwin, pfWindow *ow);
void pfPWinScreen(pfPipeWindow *pwin, int screen);
void pfPWinShare(pfPipeWindow *pwin, int mode);
void pfPWinSize(pfPipeWindow *pwin, int xs, int ys);
void pfPWinStatsWin(pfPipeWindow *pwin, pfWindow *sw);
void pfPWinType(pfPipeWindow *pwin, uint type);
void pfPWinWSConnectionName(const pfWindow *win,
const char *name);
void pfPWinWSDrawable(pfPipeWindow *pwin,
pfWSConnection dsp, pfWSDrawable gxw);
void pfPWinWSWindow(pfPipeWindow *pwin,
pfWSConnection dsp, pfWSWindow wsw);
void pfGetPWinAspect(pfPipeWindow *pwin, int *x,
int *y);
int pfGetPWinChanIndex(pfPipeWindow *pwin,
pfChannel *chan);
pfPWinFuncType pfGetPWinConfigFunc(pfPipeWindow *pwin);
void pfGetPWinCurOriginSize(pfPipeWindow *pwin, int *xo,
int *yo, int *xs, int *ys);
void pfGetPWinCurScreenOriginSize(pfPipeWindow *pwin,
int *xo, int *yo, int *xs, int *ys);
Page 2
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfState* pfGetPWinCurState(pfPipeWindow *pwin);
pfWSDrawable pfGetPWinCurWSDrawable(pfPipeWindow *pwin);
XVisualInfo* pfGetPWinFBConfig(pfPipeWindow *pwin);
int* pfGetPWinFBConfigAttrs(pfPipeWindow *pwin);
void* pfGetPWinFBConfigData(pfPipeWindow *pwin);
int pfGetPWinFBConfigId(const pfWindow *win);
pfGLContext pfGetPWinGLCxt(pfPipeWindow *pwin);
int pfGetPWinIndex(pfPipeWindow *pwin);
pfList* pfGetPWinList(const pfPipeWindow *pwin);
int pfGetPWinMode(pfPipeWindow *pwin, int mode);
const char* pfGetPWinName(pfPipeWindow *pwin);
void pfGetPWinOrigin(pfPipeWindow *pwin, int *xo,
int *yo);
pfWindow* pfGetPWinOverlayWin(pfPipeWindow *pwin);
pfPipe* pfGetPWinPipe(pfPipeWindow *pwin);
int pfGetPWinPipeIndex(const pfPipeWindow *pwin);
pfPipeVideoChannel* pfGetPWinPosPVChan(const pfPipeWindow *pwin, int x,
int y);
int pfGetPWinScreen(pfPipeWindow *pwin);
void pfGetPWinScreenOrigin(pfPipeWindow *pwin, int *xo,
int *yo);
pfWindow* pfGetPWinSelect(pfPipeWindow *pwin);
uint pfGetPWinShare(pfPipeWindow *pwin);
void pfGetPWinSize(pfPipeWindow *pwin, int *xs,
int *ys);
pfWindow* pfGetPWinStatsWin(pfPipeWindow *pwin);
uint pfGetPWinType(pfPipeWindow *pwin);
Page 3
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
const char* pfGetPWinWSConnectionName(const pfWindow *win);
pfWSDrawable pfGetPWinWSDrawable(pfPipeWindow *pwin);
Window pfGetPWinWSWindow(pfPipeWindow *pwin);
void pfPWinPVChan(pfPipeWindow* pwin, int num,
pfPipeVideoChannel *pvchan);
int pfPWinAddPVChan(pfPipeWindow* pwin,
pfPipeVideoChannel *pvchan);
void pfPWinRemovePVChan(pfPipeWindow* pwin,
pfPipeVideoChannel *pvchan);
void pfPWinRemovePVChanIndex(pfPipeWindow* pwin,
int num);
int pfGetPWinNumPVChans(const pfPipeWindow* pwin);
pfPipeVideoChannel* pfGetPWinPVChan(pfPipeWindow* pwin, int num);
pfPipeVideoChannel* pfGetPWinPVChanId(pfPipeWindow* pwin, int num);
int pfGetPWinPVChanIndex(pfPipeWindow* pwin,
pfPipeVideoChannel *pvchan);
void pfBindPWinPVChans(pfPipeWindow* pwin);
void pfUnbindPWinPVChans(pfPipeWindow* pwin);
int pfAttachPWin(pfPipeWindow *pwin0,
pfPipeWindow *pwin1);
int pfAttachPWinWin(pfPipeWindow *pwin, pfWindow *w);
void pfClosePWin(pfPipeWindow *pwin);
void pfClosePWinGL(pfPipeWindow *pwin);
void pfConfigPWin(pfPipeWindow *pwin);
void pfOpenPWin(pfPipeWindow *pwin);
int pfIsPWinOpen(pfPipeWindow *pwin);
int pfIsManagedPWin(pfPipeWindow *pwin);
int pfMQueryPWin(pfPipeWindow *pwin, int *which,
int *dst);
Page 4
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
int pfQueryPWin(pfPipeWindow *pwin, int which,
int *dst);
pfFBConfig pfChoosePWinFBConfig(pfPipeWindow *pwin,
pfWSConnection dsp, int screen, int *attr);
pfWindow* pfSelectPWin(pfPipeWindow *pwin);
void pfAttachPWinSwapGroup(pfPipeWindow* pwin0,
pfPipeWindow* pwin1);
void pfAttachPWinWinSwapGroup(pfPipeWindow* pwin,
pfWindow* win);
int pfPWinInSwapGroup(pfPipeWindow* pwin);
void pfPWinSwapBarrier(pfPipeWindow* pwin, int barrier);
int pfGetPWinSwapBarrier(pfPipeWindow* pwin);
void pfSwapPWinBuffers(pfPipeWindow *pwin);
int pfGetNumChans(const pfPipeWindow *pwin);
int pfAddChan(pfPipeWindow *pwin, pfChannel *chan);
pfChannel* pfGetChan(pfPipeWindow *pwin, int which);
void pfInsertChan(pfPipeWindow *pwin, int where,
pfChannel *chan);
void pfMoveChan(pfPipeWindow *pwin, int where,
pfChannel *chan);
void pfRemoveChan(pfPipeWindow *pwin, pfChannel *chan);
extern void pfInitGfx(void);
/* pfPipeWindow-specific types */
typedef void (*pfPWinFuncType)(pfPipeWindow *pw);
/* X-Window system based Performer types */
typedef Display *pfWSConnection;
typedef XVisualInfo pfFBConfig;
typedef Window pfWSWindow;
typedef Drawable pfWSDrawable;
typedef GLXFBConfigSGIX pfGLXFBConfig;
typedef GLXContext pfGLContext;
Page 5
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfPipeWindow is derived from the parent class
pfObject, so each of these member functions of class pfObject are also
directly usable with objects of class pfPipeWindow. Casting an object of
class pfPipeWindow to an object of class pfObject is taken care of
automatically. This is also true for casts to objects of ancestor
classes of class pfObject.
void pfUserDataSlot(pfObject *obj, int slot, void *data);
void pfUserData(pfObject *obj, void *data);
void* pfGetUserDataSlot(pfObject *obj, int slot);
void* pfGetUserData(pfObject *obj);
int pfGetNumUserData(pfObject *obj);
int pfGetNamedUserDataSlot(const char *name);
const char* pfGetUserDataSlotName(int slot);
int pfGetNumNamedUserDataSlots(void);
int pfDeleteGLHandle(pfObject *obj);
Since the class pfObject is itself derived from the parent class
pfMemory, objects of class pfPipeWindow can also be used with these
functions designed for objects of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
PARAMETERS
pwin identifies a pfPipeWindow.
dsp identifies a pfWSConnection.
wsw identifies a pfWSWindow.
gxw identifies a pfWSDrawable.
gc identifies a pfGLContext.
Page 6
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
DESCRIPTION
OpenGL Performer programs render a pfChannel to a pfPipeWindow of the
same parent pfPipe. Multiple pfPipeWindows can be open on a single
pfPipe. A pfPipe and all of its windows have the same screen, or hardware
graphics pipeline. By default, pfChannels are assigned to the first
pfPipeWindow of a pfPipe. pfChannels can be removed from the
pfPipeWindow and assigned to other pfPipeWindows. pfPipeWindows can be
opened/closed and created at any time. Refer to the pfPipe man page for
more information on how pfPipeWindows fit into the hierarchy of pfPipes,
pfPipeWindows, and pfChannels.
pfPipeWindows are similar to pfWindows but are tracked/maintained by
libpf and are needed by libpf to draw pfChannels. Because of their
similarity, many of the pfPipeWindow routines are identical to pfWindow
routines except for the fact that the pfPWin<*> routines operate on a
pfPipeWindow and the pfWin<*> routines operate on a pfWindow. These
corresponding routines are listed in the table below and their
functionality is documented in the pfWindow man page. Routines
documented here have special extended functionality for pfPipeWindows.
Page 7
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfPipeWindow routine pfWindow routine
__________________________________________________________
pfPWinAspect pfWinAspect
pfPWinFBConfig pfWinFBConfig
pfPWinFBConfigAttrs pfWinFBConfigAttrs
pfPWinFBConfigData pfWinFBConfigData
pfPWinFBConfigId pfWinFBConfigId
pfPWinFullScreen pfWinFullScreen
pfPWinGLCxt pfWinGLCxt
pfPWinIndex pfWinIndex
pfPWinMode pfWinMode
pfPWinName pfWinName
pfPWinOrigin pfWinOrigin
pfPWinOriginSize pfWinOriginSize
pfPWinOverlayWin pfWinOverlayWin
pfPWinScreen pfWinScreen
pfPWinShare pfWinShare
pfPWinSize pfWinSize
pfPWinStatsWin pfWinStatsWin
pfPWinWSConnectionName pfWinWSConnectionName
pfPWinWSDrawable pfWinWSDrawable
pfPWinWSWindow pfWinWSWindow
pfGetPWinAspect pfGetWinAspect
pfGetPWinCurOriginSize pfGetWinCurOriginSize
pfGetPWinCurScreenOriginSize pfGetWinCurScreenOriginSize
pfGetPWinCurState pfGetWinCurState
pfGetPWinCurWSDrawable pfGetWinCurWSDrawable
pfGetPWinFBConfig pfGetWinFBConfig
pfGetPWinFBConfigAttrs pfGetWinFBConfigAttrs
pfGetPWinFBConfigData pfGetWinFBConfigData
pfGetPWinFBConfigId pfGetWinFBConfigId
pfGetPWinGLCxt pfGetWinGLCxt
pfGetPWinIndex pfGetWinIndex
pfGetPWinList pfGetWinList
pfGetPWinMode pfGetWinMode
pfGetPWinName pfGetWinName
pfGetPWinOrigin pfGetWinOrigin
pfGetPWinOverlayWin pfGetWinOverlayWin
pfGetPWinScreen pfGetWinScreen
pfGetPWinSelect pfGetWinSelect
pfGetPWinShare pfGetWinShare
pfGetPWinSize pfGetWinSize
|
Page 8
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfPipeWindow routine pfWindow routine
____________________________________________________
pfGetPWinStatsWin pfGetWinStatsWin
pfGetPWinType pfGetWinType
pfGetPWinWSConnectionName pfGetWinWSConnectionName
pfGetPWinWSDrawable pfGetWinWSDrawable
pfGetPWinWSWindow pfGetWinWSWindow
pfChoosePWinFBConfig pfChooseWinFBConfig
pfAttachPWin pfAttachWin
pfSelectPWin pfSelectWin
pfAttachPWinSwapGroup pfAttachWinSwapGroup
pfAttachPWinWinSwapGroup pfAttachWinSwapGroup
pfPWinInSwapGroup pfWinInSwapGroup
pfPWinSwapBarrier pfWinSwapBarrier
pfGetPWinSwapBarrier pfGetWinSwapBarrier
pfSwapPWinBuffers pfSwapWinBuffers
pfIsPWinOpen pfIsWinOpen
pfIsManagedPWin pfIsManagedWin
pfQueryPWin pfQueryWin
pfMQueryPWin pfMQueryWin
|
pfNewPWin creates and returns a handle to a pfPipeWindow on the screen
managed by pipe. Like other pfUpdatables, pfPipeWindows are always
allocated from shared memory. The pipe of a pfPipeWindow cannot be
changed. pfGetPWinPipe returns a pointer to the pfPipe of pwin. Like
other pfObjects, pfPipeWindows must be created in the application
process.
pfGetPWinClassType returns the pfType* for the class pfPipeWindow. The
pfType* returned by pfGetPWinClassType is the same as the pfType*
returned by invoking pfGetType on any instance of class pfPipeWindow.
Because OpenGL Performer allows subclassing of built-in types, when
decisions are made based on the type of an object, it is usually better
to use pfIsOfType to test if an object is of a type derived from a
Performer type rather than to test for strict equality of the pfType*'s.
pfWinFBConfigId allows you to directly set the OpenGL X visual id to be
used in configuring the resulting OpenGL/X window. pfGetWinFBConfigId
will return the current OpenGL visual id of the window (or -1 if the id
is not known). This routine is useful in multiprocess operation if you
want to be able to directly specify the framebuffer configuration of an X
window in the application process. See the XVisualIDFromVisual(3X11) and
XGetVisualInfo(3X11) man pages for more information about X visuals.
pfPWinScreen will set the screen of pwin and on the parent pfPipe. Once
set, the screen cannot be changed. If the screen of the parent pfPipe
had already been set when the pfPipeWindow was created, the pfPipeWindow
will inherit that screen setting and will not accept another. The
pfPipeWindow will direct all rendering comments to the hardware graphics
pipeline specified by screen. As with pfWindows, if a screen is never
Page 9
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
set, the default screen of the current window system connection will be
set as the screen when the window is opened with pfOpenPWin::.
pfGetPWinScreen will return the screen of the pfPipeWindow. If the
screen has not yet been set, (-1) will be returned. See the
pfGetCurWSConnection man page for more information on the specification
of a default screen. See the pfPipeScreen man page for special
restrictions and proper specification of pfPipe and pfPipeWindow screens
in multipipe configurations.
pfPWinWSConnectionName allows you to specify the exact window server and
default screen for the successive opening of the window. This can be used
for specifying remote displays or on machines running more than one
window server. pfGetPWinWSConnectionName will return the name specifying
the current window server target. As with the setting of screens, a
window server target specified on a pfPipe will take precedence over a
target set on a pfPipeWindow. If a window server target is not specified
for the parent pfPipe of a pfPipeWindow, the parent pfPipe will inherit
the window setting. Because of these restrictions, this routine must be
called in the application process, before the first call to pfFrame. See
the pfPipeScreen man page for special restrictions and proper
specification of pfPipe and pfPipeWindow screens in multipipe
configurations.
pfGetPWinIndex returns the index of pwin in the pfPipeWindow list of the
parent pfPipe.
pfChannels are assigned to a pfPipeWindow upon their creation.
pfPipeWindows also have list-style API for adding, removing, inserting,
and reordering pfChannels on a pfPipeWindow: pfAddChan will append chan
as the last pfChannel of pwin and and returns the resulting index or (-1)
if an error was encountered. pfInsertChan will insert chan as the
whereth pfChannel of pwin. pfMoveChan will move chan from its current
position in the pfChannel list of pwin to position where. If chan does
not belong to pwin, no action is taken and an error flag of (-1) is
returned; otherwise, where is returned. pfRemoveChan will remove chan
from pwin. If chan does not belong to pwin, no action is done and an
error flag of (-1) is returned. Otherwise, the previous index of chan is
returned. pfGetChan returns a pointer to the indexth pfChannel of pwin.
pfGetNumChans returns the number of pfChannels attached to pwin.
pfGetPWinChanIndex returns the index of the chan in the channel list, or
(-1) if the pfChannel is not attached to pwin.
pfClosePWin can be called from the application process to close a window.
However, if additional draw process work is needed to be done, a
pfConfigPWin draw process callback should be used.
pfConfigPWin, called from the application process, will trigger the
configuration callback function to be called in the draw process for the
current frame. If no user configuration callback function has been
specified, a default configuration function will be called that will open
and initialize pwin. pfPWinConfigFunc, called from the application
process, specifies a draw process callback function, func, to configure
Page 10
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pwin. The configure function can be used to make draw process calls to
open, initialize, and close pfPipeWindows. In this window configuration
callback function pfOpenPWin can be called on the pfPipeWindow, or an
OpenGL window can be created and assigned to the pfPipeWindow.
pfGetPWinConfigFunc returns the pointer to the user-specified window
configuration callback function, or NULL of no such function has been
set. If the application is multiprocessed, the window is opened
asynchronously in the DRAW process. The draw process is activated by a
call to pfFrame. This means that an immediate query of state from the APP
process after an APP process call to pfOpenPWin or pfConfigPWin may not
return valid results.
pfOpenPWin will cause pwin to be opened and initialized via pfInitGfx. If
called from the application process, the pfPipeWindow will be
automatically opened in the draw process for the corresponding frame. If
called in the draw process, the pfPipeWindow will be opened
automatically. Similarly, pfClosePWin and pfClosePWinGL can be called
from either the application process or the draw process and will cause
the pwin or the graphics context, respectively, to be closed in the draw
process for the given frame. If application specific work needs to be
done in the draw process for manipulating pfPipeWindows, pfConfigPWin
should be used.
OpenGL Performer automatically calls pfInitGfx for windows that it
creates and opens. For pfPipeWindows, pfInitGfx does the same operations
as for pfWindows, and in addition, will apply a default material and a
default MODULATE texture environment (pfApplyTEnv), and enable backface
culling (pfCullFace(PFCF_BACK)).
pfPWinList can be used to specify a pfList of pfWindows, wlist, that can
draw into a single pfPipeWindow. This enables a pfPipeWindow to maintain
a list of alternate framebuffer configurations for the base pfPipeWindow.
A pfPipeWindow always maintains a default main graphics pfWindow and a
pfWindow list. Two of the windows in this list are so commonly needed
that they have special names and can be created automatically for the
user: OVERLAY and STATS. The user can also add his own pfWindows to the
pfWindow list for additional configurations. This list may only hold
pfWindows, NOT pfPipeWindows. With window lists, we have an effective
pfWindow hierarchy of: screen->pfPipe->pfPipeWindow[graphics, stats,
overlay, ...]->pfChannel(s). See the pfWinList man page for more
information on these alternate framebuffer configuration windows.
pfPWinIndex selects pfWindow index from the alternate configuration
window list to be the current pfWindow the pfPipeWindow shall render to.
All the pfChannels attached to the pfPipeWindow will automatically be
drawn into this current pfWindow. See pfWinIndex for more details of
this operation. pfGetPWinIndex will return the current index of the
pfPipeWindow.
pfPWinType sets the type of a pfPipeWindow where type is an or-ed bitmask
that may contain the type constants listed below. pfGetPWinType returns
the type of a pfPipeWindow. A change in the type of a pfPipeWindow takes
Page 11
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
effect upon the call to pfOpenPWin. The type of an open pfPipeWindow
cannot be changed. The pfWindow type attributes all start with
PFPWIN_TYPE_ and are:
PFPWIN_TYPE_X
has identical characteristics to the PFWIN_TYPE_X specification
for pfWindows. See the pfWinType man page for more
information.
PFPWIN_TYPE_SHARE
Specifies that this window should be automatically attached to
the first pfPipeWindow on the parent pfPipe. See the
pfAttachWin man page for more details.
PFPWIN_TYPE_STATS
has identical characteristics to the PFWIN_TYPE_STATS
specification for pfWindows. See the pfWinType man page for
more information.
PFPWIN_TYPE_PBUFFER
The window drawable will be created in a pbuffer. For this,
you must also specify an GLXFBConfigSGIX with pfPWinFBConfig
before the window is opened.
PFPWIN_TYPE_NOXEVENTS
OpenGL Performer will not track X configuration events
(resizing, repositioning, etc.) on this window. This can save
a little bit of system overhead so for a deployed, static,
real-time flight simulator in "training" mode where every
little bit counts, use this. In development mode, or for
interactive applications, you probably want to leave this off.
PFPWIN_TYPE_UNMANAGED
OpenGL Performer will not do automatic X window management on
this window. This includes size and position tracking,
resizing of alternate configuration windows, and swapbuffers.
OpenGL Performer will still make the graphics context of this
window current if it is open for a pfPipe to render to and has
attached pfChannels. pfPipeWindows with drawables that are of
type GLXPbufferSGIX or Pixmap are automatically made unmanaged.
pfGetPWinOrigin returns the cached parent relative origin of win, if
open, from the last time the window size was set or an X configuration
event was detected. Otherwise it returns the origin and size set by
pfPWinOrigin.
pfGetPWinSize returns the cached size of win, if open, from the last time
the window size was set or an X configuration event was detected.
Otherwise it returns the size set by pfPWinSize.
pfGetPWinScreenOrigin returns the cached screen relative origin of win,
if open, from the last time the pwin size was set or an X configuration
Page 12
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
event was detected. Otherwise it returns the origin and size set by
pfPWinOrigin.
pfPWinPVChan sets pfPipeVideoChannel pvchan for the pfPipeWindow pwin
based on the index num. pfGetPWinPVChan performs the opposite task,
returning a pointer to the num'th pfPipeVideoChannel of the pfPipeWindow.
The total number of pfPipeVideoChannels associated with the pfPipeWindow
is returned by pfGetPWinNumPVChans.
pfPWinAddPVChan adds the pfPipeVideoChannel pvchan to a pfPipeWindow and
returns the resulting index or (-1) if an error was encountered. If
pvchan has not already been assigned a hardware video channel, then the
next active hardware video channel after the previous pfPipeVideoChannel
on the pfPipeWindow will be assigned to the new pfPipeVideoChannel. This
assignment can be changed with pfPVChanId. pfPipeWindows start out with
an initial pfPipeVideoChannel that will reference the first active
hardware video channel.
pfPWinRemovePVChan removes the pfPipeVideoChannel pvchan from a
pfPipeWindow using the pfPipeVideoChannel's pointer as search through the
list, while pfPWinRemovePVChanIndex is used to remove the
pfPipeVideoChannel indexed by num from the pfPipeWindow's
pfPipeVideoChannel list.
The index value can be obtained from pfGetPWinPVChanIndex which returns
the index of pfPipeVideoChannel pvchan. The opposite action is provided
by pfGetPWinPVChanId which accepts the argument num and returns the
pointer to the num'th pfPipeVideoChannel of the indicated pfPipeWindow.
All of the pfPipeVideoChannels associated with a pfPipeWindow can be
bound with pfBindPWinPVChans and unbound with pfUnbindPWinPVChans.
pfGetPWinPosPVChan returns the pointer to the pfPipeVideoChannel on pwin
that contains the screen relative position x, yx. This can be useful for
getting the pfPipeVideoChannel that contains the mouse.
pfAttachPWin will add the windows of the share group of pwin1 to that of
pwin0. pfAttachPWinWin will place the pfWindow win in the share group of
pwin. pfPipeWindow share groups can contain pfWindow so long as the
primary group window is a pfPipeWindow. This is useful if you want to
have a process sproced off the DRAW process with a pfWindow and graphics
context for creating OpenGL display lists and textures shared with the
pfPipeWindow of the main drawing process.
pfAttachPWinSwapGroup will add the windows of the swap group of pwin1 to
that of pwin0. pfAttachPWinWinSwapGroup will place the pfWindow win in
the swap group of pwin. pfPipeWindow swap groups can contain pfWindow so
long as the primary group window is a pfPipeWindow. The swap group API
is only supported under OpenGL operation. OpenGL programs can use the
PFCHAN_SWAPBUFFERS_HW share token with pfChannel share groups to easily
and automatically create window swap groups.
Page 13
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
EXAMPLES
The following is an example of basic pfPipeWindow creation:
{ /* in the application process after pfConfig() */
pfPipeWindow *pw;
pw = pfNewPWin(pfGetPipe(0));
pfPWinName(pw,"PipeWin");
pfPWinOriginSize(pw, 0, 0, 500, 500);
pfPWinType(pw, PFPWIN_TYPE_X);
pfOpenPWin(pw);
/* set off the draw process to open window */
pfFrame();
}
If special draw process operations are to be done with the opening of the
window, a pfConfigPWin callback function should be used.
{
/* in the application process pfPipeWindow init callback */
pfPWinConfigFunc(pw,OpenPipeWin);
/* trigger the draw process to call the config callback
* for this frame
*/
pfConfigPWin(pw);
}
/* in the draw process pfPipeWindow init callback */
void OpenPipeWin(pfPipeWindow *pw)
{
pfOpenPWin(pw);
/* do other application specific draw process work,
* such as downloading scene textures, displaying
* welcome messages, etc.
*/
}
If you have triggered the opening of a pfPipeWindow from the application
process, you may have to wait for it to be opened in the DRAW process to
do queries that depend on state of an opened window. While you wait, you
must call pfFrame to trigger DRAW frames.
while (!pfIsPWinOpen(pwin)) pfFrame();
The following is an example that shows the creation of multiple
pfPipeWindows for a single pfPipe and the assignment of pfChannels to the
different windows:
Page 14
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
{
pfChannel *chan[MAX_CHANS];
pfPipeWindow *pwin[MAX_PWINS];
pfPipe *p = pfGetPipe(0);
for (int loop=0; loop < NumWins; loop++)
{
pfPipeWindow *pw;
char str[PF_MAXSTRING];
pwin[loop] = pfNewPWin(p);
sprintf(str, "OpenGL Performer - Win %d", loop);
pfPWinName(pwin[loop], str);
pfPWinOriginSize(pwin[loop], (loop&0x1)*315, ((loop&0x2)>>1)*340, 300, 300);
pfPWinConfigFunc(pwin[loop], OpenPipeWin);
pfConfigPWin(pwin[loop]);
}
/* Create and configure a pfChannel for each pfPipeWindow. */
for (int loop=0; loop < NumWins; loop++)
{
chan[loop] = pfNewChan(p);
pfAddChan(pwin[loop], chan[loop]);
}
/* set off the draw process to config window */
pfFrame();
}
pfOpenPWin and pfClosePWin can both be called from the application
process, or from the draw process. The following example demonstrates
using pfConfigPWin to close a pfPipeWindow:
{
/* in the application process specify a close config func */
pfPWinConfigFunc(pw,ClosePipeWin);
pfConfigPWin(pw);
}
/* in the draw process pfPipeWindow init callback */
void ClosePipeWin(pfPipeWindow *pw)
{
pfClosePWin(pw);
/* do other application specific draw process calls */
}
Page 15
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
NOTES
pfPipeWindows handle the multiprocessing details of OpenGL Performer
applications for pfWindows. pfPipeWindows must be created in the
application process. However, with some minor exceptions, pfPipeWindows
may be configured, opened, closed, and edited in either the application
process or draw process. Typically, a pfPipeWindow is created and
configured in the application process. Custom graphics state is
initialized in a pfPWinConfigFunc callback function. The pfPipeWindow of
a channel or a channel's position in a pfPipeWindow list may only be
modified in the application process. The specification of the current
drawing window with pfSelectPWin must be done in the drawing process.
Explicit specification of the pfGLContext or pfFBConfig must be done in
the drawing process. pfPipeWindow queries are also best done in the draw
process as the query may have to access the graphics context to provide
the requested information.
The following table shows from which process pfPipeWindow routines may be
called.
pfPipeWindow routine Application Process Draw Process
___________________________________________________________
pfNewPWin Yes No
pfPWinAspect Yes Yes
pfPWinConfigFunc Yes No
pfPWinFBConfig Yes No
pfPWinFBConfigAttrs Yes Yes
pfPWinFBConfigData No Yes
pfPWinFBConfigId Yes Yes
pfPWinFullScreen Yes Yes
pfPWinGLCxt No Yes
pfPWinIndex Yes Yes
pfPWinList Yes Yes
pfPWinMode Yes Yes
pfPWinName Yes Yes
pfPWinOrigin Yes Yes
pfPWinOriginSize Yes Yes
pfPWinOverlayWin Yes Yes
pfPWinScreen Yes Yes
pfPWinShare Yes Yes
pfPWinSize Yes Yes
pfPWinStatsWin Yes Yes
pfPWinType Yes Yes
pfPWinWSConnectionName Yes No
pfPWinWSDrawable Yes Yes
pfPWinWSWindow Yes Yes
|
|
Page 16
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
pfPipeWindow routine Application Process Draw Process
__________________________________________________________
pfAttachPWin Yes Yes
pfPWinAddPVChan Yes Yes
pfClosePWin Yes Yes
pfClosePWinGL Yes Yes
pfConfigPWin Yes Yes
pfOpenPWin Yes Yes
pfIsPWinOpen Yes Yes
pfMQueryPWin No Yes
pfQueryPWin No Yes
pfChoosePWinFBConfig No Yes
pfSelectPWin No Yes
pfAttachPWinSwapGroup Yes Yes
pfPWinSwapBarrier Yes Yes
pfSwapPWinBuffers No Yes
pfGetNumChans Yes Yes
pfAddChan Yes No
pfGetChan Yes Yes
pfInsertChan Yes No
pfMoveChan Yes No
pfRemoveChan Yes No
|
|
Note that whenever any pfObjects are given to a pfPipeWindow, such as
pfPWinList, the data must be valid for access by the graphics process.
This data, such as pfLists and pfWindows, should always be allocated from
shared memory. Structures provided by X, such as that returned by
pfChoosePWinFBConfig, or pfChooseFBConfig, will not have been allocated
in shared memory. Therefore, those routines must be called from the draw
process. Under OpenGL operation, pfWinFBConfigId can be used to set the
framebuffer configuration of an X window in the application process.
pfPipeWindows support windows in the multiprocessed libpf environment and
are the glue between pfChannels and pfPipes. There are times when you
might want to use pfWindows, instead of pfPipeWindows, even in a libpf
application. For example, popping up a simple dialog window in the draw
process should use pfWindows and not pfPipeWindows. Additionally, if you
want to maintain alternate windows with different visual (framebuffer)
configurations for your pfPipeWindow, you use pfWindows that are
alternate framebuffer configurations for the base pfPipeWindow. The
PFWIN_STATS_WIN, PFWIN_OVERLAY_WIN, and other pfPWinList windows must
themselves be pfWindows and not pfPipeWindows. See the pfPWinList
routine below and the pfWindow man page for more information.
X Window origin and size: There are some subtle issues in the management
of origin and size of X windows.It can be very expensive to immediately
obtain the current screen relative origin of a window, particularly if
the window is in a hierarchy. pfPipeWindows have the size and position
of the window tracked by the application process. However, it is still
recommended that user code should not rely on knowning the up to date
screen relative origin but should be window-coordinate relative to be
efficient and reliable.
Page 17
pfPipeWindow(3pf) OpenGL Performer 3.2.2 libpf C Reference Pages
Gang Swap Swap groups can contain windows from separate pfPipes rendering
to different graphics pipelines and force that their double-buffering is
synchronized so that they are guaranteed to always be displaying the same
frame and have their hardware swapbuffers happen simultaneously. This is
often referred to as Gang Swap. For this to work, you must first have
the graphics pipelines genlocked. See the genlock(7) man page for more
informations. Next, you must connect the proper cable between the
SwapReady connectors on the graphics pipelines. On the InfiniteReality
this is a simple BNC cable of any Ohms.
BUGS
pfPipeWindows cannot be deleted.
Detach from share groups and swap groups is not supported.
SEE ALSO
pfNewChan, pfGetPipe, pfNewWin, pfGetCurWSConnection, genlock,
XGetVisualInfo, XVisualIDFromVisual
Page 18