From: Alexandre Naaman (naaman++at++laplace.engr.sgi.com)
Date: 04/26/2001 18:25:53
On Thu, 26 Apr 2001, Aaron Jones wrote:
Hi Aaron,
> Hello all,
>
> Please let me pre-apologize for the long message. I am utterly stuck on
> this problem, so I will present here as much as I can figure out about
> it, and hopefully someone will recognize the problem. =)
>
> I am trying to port an application using Volumizer/Performer/OpenGL,
> using a ViewKit gui from an Onyx2 (os and software specs below) to an
> Octane2(specs also below).
>
> It works very nice on our Onyx2, which is running irix 6.4, OSF/Motif
> Exec Enviornment 1.2.4, ViewKit Exec Enviornment 1.5.0, Volumizer 1.1,
> and Performer Exec Enviornment 2.0.4 with what appears to be a million
> and a half patches and compatibility dso's (if it becomes relevant,
> I could probably post them, but the list is LONG).
>
> The octane2 is running IRIX 6.5, Motif's eoe (Motif 1.2 and 2.1
> Combined) for 6.5.10m, ViewKit exec enviorn 1.5.3, Volumizer 1.2, and
> performer 2.2.1.
>
> Somewhere in between the versions of either Motif, ViewKit, or
> Performer, something changed. I ruled out the possibilty that the
> Volumizer code is causing the problem (ie written for the Onyx2
> hardware specifically) by running a purely Performer/Volumizer app
> without the gui, and it ran just fine on the octane2.
>
> My suspision is that it has to do with interfacing Performer into an
> OpenGL widget, or the creation and configuration of the glwidget to
> become the main graphics window. The gui code was generated with
> rapidapp, and they attached the Performer window to the glwidget by
> saying
>
> /* set pfPipeWindow parameters from the Motif widget */
> Shared->pw->setWSDrawable(NULL, Motif->gXWin);
> Shared->pw->setWSWindow(NULL, Motif->gXWin);
>
> Motif->gXWin is set with this code:
>
> Motif->gXWin = XtWindow(_bulletinBoard -> getGLWidget());
>
> getGLWidget looks like this:
>
> Widget BulletinBoardUI::getGLWidget()
> {
> return _glwidget;
> }
this part of the code look ok to me.
>
> Unfortunately for me, the creators of this code are not around.
>
> OK, all of this explanation, let me tell you the symptoms:
>
> when the application comes up, the gui pops up looking correct in
> everything but the Performer window. A second window pops up, but is
> only as big as the button in the top left corner for interacting with
> the window manager (close, move, etc.). One pixel of the gui is black
> in the top left corner. The GL widget is supposed to have a 10 pixel
> offset from the corner. It is as if the main window is getting set as
> the main graphics window.
>
> I noticed that if I added the code:
>
> Display *dpy = XOpenDisplay("");
> XWindowAttributes watt;
> XGetWindowAttributes (dpy, Motif->gXWin, &watt);
> cout<<"Window width and height: "<<watt.width<<'
> '<<watt.height<<endl;
>
> the output is 1, 1, which explains why I only get on pixel on the gui.
> However, why it is 1,1 is beyond me!
Try using pfGetCurWSConnection() in lieu of calling XOpenDisplay().
>
> The glwidget is defined as follows:
>
> _glwidget = XtVaCreateManagedWidget ( "glwidget",
> glwMDrawingAreaWidgetClass,
> _baseWidget,
> GLwNrgba, True,
> GLwNdoublebuffer, True,
> GLwNallocateBackground,
> True,
> XmNx, 10,
> XmNy, 10,
> XmNwidth, 500,
> XmNheight, 500,
> GLwNvisualInfo, vi,
> (XtPointer) NULL );
>
>
> If I explicitly set Shared->pw->setSize(512, 512), then the same code
> ALMOST works.
>
> What happens is that the same second window opens (to size 512, 512) and
>
> displays nothing, and things other than that work ok. There, however,
> is still the problem of of the offset.
a better way to do this would be to do:
Shared->pw->setOriginSize(10,10,500,500);
>
> A second problem occurs when I try to put it into a special mode (stereo
> which requires special glasses to look at, the monitor does not change
> resolutions, it merely displays two images side by side, and the glasses
> are mirrored to show each eye its own view). The code uses a bunch of
> XtVaSetValues commands to stretch the gui out, move the scale widgets
> and stretch the opengl window. Let me reiterate that it works perfectly
> on the Onyx2. On the Octane2 though, the main gui window expands just
> fine. But the widgets don't move, and the gl window doesn't expand.
> Perhaps it is as simple as needing a different command to change it,
> rather than set it, but I have had no luck. The code for moving the
> widgets looks like (one example is:)
>
> // Contrast Slider
> XtVaSetValues ( _contrastscale,
> XmNx, 690+700,
> (XtPointer) NULL );
>
> the code for expanding the gl widget is:
>
> XtVaSetValues(_glwidget,
> XmNwidth,500+700,
> (XtPointer) NULL);
>
> The sizes are written as summations to make it clear exactly what is
> going on. The 500 is the original size, and they are expanding it by
> 700.
See comment above about using pfPipeWindow::setOriginSize(). I would use
this in lieu of the Xt stuff if it were me.
Try doing Shared->pw->getSize(&width,&height) to see what your
pfPipeWindow's size is after/before calling XtVaSetValues() for setting
the width and offset.
>
> So in summary, for some reason, the program thinks that the graphics
> window is 1 by 1, the Performer Pipewindow pops up in the background for
> no apparent reason, displaying nothing, and my widgets don't move when I
> use an XtVaSetValues command...
>
> So if anyone knows what is wrong here, I would appreciate the help
> VERY VERY VERY much.
>
Just for fun, one other thing you can try:
pfMultiprocess(PFMP_APPCULLDRAW);
and see if things improve. If they do then what's probably happening is
that your _glwidget is NULL when you call pfPipeWindow::setWSDrawable()
and pfPipeWindow::setWSWindow(). But that's a pretty far fetched guess ...
For more ideas about how to integrate Motif apps with Performer check out
/usr/share/Performer/src/pguide/libpf/C++/motif.C.
A+,
Alexandre.
-- Alexandre Naaman - naaman++at++sgi.com - La conformite est la mort de l'ame.
This archive was generated by hypermail 2b29 : Thu Apr 26 2001 - 18:25:58 PDT