Tanaka, Ken (Ken.Tanaka++at++williams.af.mil)
Fri, 6 Nov 1998 08:56:18 -0700
Can you tell me if initializing the graphics widget in code snippet A is
equivalent to code snippet B? Primarily of interest is the creation of
glwidget by Xt[Va]CreateManagedWidget--is "GLwNrgba..GLwNdepthSize" an
acceptable substitute for "GLwNvisualInfo" returned by pfChooseFBConfig()?
If so, my application can be setup as in snippet A, with pfInit() following
widget creation. I've noticed that leaving out "GLwNdepthSize, 24," as in
some
examples I've encountered (pfview/Viewer.C, a Performer and RapidApp
example),
don't zbuffer correctly, yielding inside-out looking geometry.
Thanks,
Ken Tanaka
Air Force Research Laboratory Phone: 602 988 9773 x 413
Raytheon/Boeing/Lockheed-Martin Fax: 602 988 3556
Email: ken.tanaka++at++williams.af.mil
A ---------------------------- (from output of BX Pro, C++/ViewKit mode)
// ":" indicates one or more delete lines
struct SharedData
{
pfPipeWindow *pw;
pfChannel *chan;
pfScene *scene;
:
};
typedef struct MotifData_t {
Window xWin, gXWin;
XtWorkProcId work_id;
}MotifData_t;
// Inter-process communication structures
static SharedData *Shared;
MotifData_t *Motif;
:
// frame is the parent widget of class xmFrameWidgetClass
ac = 0;
XtSetArg(args[ac], GLwNrgba, True); ac++;
XtSetArg(args[ac], GLwNstencilSize, 4); ac++;
XtSetArg(args[ac], GLwNdoublebuffer, True); ac++;
XtSetArg(args[ac], GLwNdepthSize, 24); ac++;
XtSetArg(args[ac], XmNwidth, 600); ac++;
XtSetArg(args[ac], XmNheight, 400); ac++;
glwidget = XtCreateManagedWidget("glwidget",
glwMDrawingAreaWidgetClass,
frame,
args,
ac);
:
// Performer Initialization
pfInit();
// Malloc into Performer Shared Memory the Shared Arena
Shared = (SharedData*)pfMalloc(sizeof(SharedData),
pfGetSharedArena());
:
pfConfig();
:
Motif = (MotifData_t*)pfMalloc(sizeof(MotifData_t), pfGetSharedArena());
:
// Build initial scene graph
// Enter Application loop
B ---------------------------- (from Performer/src/pguide/libpf/C++/motif.C)
:
// Performer Initialization
pfInit();
// Allocate shared before fork()'ing motif so that all
// processes see the Shared pointer.
Shared = (SharedData*)pfCalloc(1, sizeof(SharedData),
pfGetSharedArena());
:
Motif = (MotifData_t*)pfCalloc(1, sizeof(MotifData_t),
pfGetSharedArena());
:
// initiate multi-processing mode set in pfMultiprocess call
pfConfig();
:
// Create Performer Window
// Build initial scene graph
:
// MOTIF PART
// frame is the parent widget of class xmFrameWidgetClass
XVisualInfo *vinfo;
Display *xdpy;
xdpy = XtDisplay( toplevel );
vinfo = pfChooseFBConfig(xdpy, -1, NULL);
glwidget = XtVaCreateManagedWidget ( "glwidget",
glwMDrawingAreaWidgetClass,
frame,
GLwNvisualInfo, vinfo,
XmNwidth, 600,
XmNheight, 400,
(XtPointer) NULL );
:
// Enter Application loop
This archive was generated by hypermail 2.0b2 on Fri Nov 06 1998 - 07:56:41 PST