Finding Screen Coordinates

New Message Reply Date view Thread view Subject view Author view

Larry Peruski (peruski++at++lep.cs.gmr.com)
Mon, 15 Apr 1996 08:07:01 -0400


On Apr 15, 11:08am, Vali Lalioti wrote:
> Subject:
> Dear Sirs,
>
> I have a problem with using two pipes and two screens on a machine that
> is set to the "triple keyboard option" (TKO). The warning I get is that
> there is no screen 1, which probably is true since with this option
> the displays are 0.0, 1.0,2.0 instead of 0.0, 0.1, 0.2.
> Is there any way to solve this problem?
> I include a small example and the error messages.
>
> sincerely yours,
> Dr. V. Lalioti.
>
> ---------------------------
>
> #include <Performer/pf.h>
> #include <Performer/pfdu.h>
> #include <Performer/pf/pfPipe.h>
> #include <Performer/pf/pfPipeWindow.h>
> #include <Performer/pf/pfChannel.h>
> #include <Performer/pf/pfGeode.h>
> #include <Performer/pr/pfLight.h>
> #include <Performer/pr/pfMaterial.h>
>
> int
> main(int argc, char** argv)
> {
> pfInit();
> pfMultiprocess( PFMP_APPCULLDRAW );
> pfMultipipe(2);
> pfConfig();
>
> pfWSConnection con0 = pfOpenScreen(0, FALSE);
> pfWSConnection con1 = pfOpenScreen(1, FALSE);
>
> pfPipe* pipe0 = pfGetPipe(0);
> pfPipe* pipe1 = pfGetPipe(1);
>
> pipe0->setScreen(0);
> pipe1->setScreen(1);
>
> pipe0->setWSConnectionName("sumo:0.0");
> pipe1->setWSConnectionName("sumo:1.0");
>
> printf("pipe0->getPipeScreen() = %d\n", pipe0->getScreen());
> printf("pipe1->getPipeScreen() = %d\n", pipe1->getScreen());
>
> printf("pipe0->getWSConnectionName() = %s\n",
> pipe0->getWSConnectionName());
> printf("pipe1->getWSConnectionName() = %s\n",
> pipe1->getWSConnectionName());
>
> pfPipeWindow* window0 = new pfPipeWindow(pipe0);
> window0->setWinType( PFPWIN_TYPE_X );
> window0->setName( "I am on pipe 0" );
> window0->setOriginSize(0, 0, 500, 500);
> window0->open();
>
> pfPipeWindow* window1 = new pfPipeWindow(pipe1);
> window1->setWinType( PFPWIN_TYPE_X );
> window1->setName( "I am on pipe 1" );
> window1->setOriginSize(600, 0, 500, 500);
> window1->open();
>
> pfScene* scene = new pfScene;
> pfGeode* geode = new pfGeode;
> pfGeoSet* gset = pfdNewCube(pfGetSharedArena());
>
> scene->addChild(geode);
> geode->addGSet(gset);
>
> // pfEnable(PFEN_LIGHTING);
>
> // pfLight* light = new pfLight;
>
> // pfLightModel* lmodel = new pfLightModel;
> // lmodel->apply();
>
> pfMaterial* material = new pfMaterial;
> // material->apply();
>
> pfChannel* channel0 = new pfChannel(pipe0);
> pfChannel* channel1 = new pfChannel(pipe1);
> channel0->attach(channel1);
> channel0->setShare(channel0->getShare() | PFCHAN_SWAPBUFFERS);
>
> channel0->setFOV(45.0f, 0.0f);
> channel0->setNearFar(0.1f, 100.0f);
> channel0->setScene(scene);
>
> window0->addChan(channel0);
> window1->addChan(channel1);
>
> float drift = 0.04f;
> float xpos = -1.0f;
>
>
> while (1) {
>
> // this is it
>
> if (drift < 0.0f) {
> if (xpos < -1.0f) {
> drift = -drift;
> }
> } else {
> if (xpos > 1.0f) {
> drift = -drift;
> }
> }
>
> xpos += drift;
>
> pfVec3 pos(xpos, -6.0f, 0.0f);
> channel0->setView(pos, pfVec3(0.0f, 0.0f, 0.0f));
> // light->setPos(pos[0], pos[1], pos[2], 1.0);
> // light->on();
>
> pfFrame();
> channel0->drawStats();
> // channel1->drawStats();
> }
>
> pfExit();
> return 0;
> }
>
> ----------------- error messages
> PF Warning/Usage: pfPipe::setScreen() pfPipe 1 screen request of
1 is greater than number of available hardware screens (0 - 0). Clamping to
screen 0
> pipe0->getPipeScreen() = 0
> pipe1->getPipeScreen() = 0
> pipe0->getWSConnectionName() = sumo:0.0
> pipe1->getWSConnectionName() = sumo:1.0
> PF Notice: Using 50Hz video rate
> GL: X error 3, X request = 3
> ERROR #93 Error in communication with window server: ERR_WMANIPC
> PF Notice: Caught SIGCHLD. Exiting due to death of child
with pid 3827.
>
>
>-- End of excerpt from Vali Lalioti

I reported this same problem back in early Feb. I logged a support call and
provided a source program similar to the one above. An SGI engineer was
assigned but I never received a solution.

It's a real simple question. How do you open a window on screen 1.0 or 2.0
using Performer 2.0 with TKO installed? I never had a problem with Performer
1.2.

I have been busy with other things so I haven't forced this issue but I sure
would like to know if there is an answer.

-- 
Larry Peruski 
Sr Project Engineer
Manufacturing & Design Systems Dept
GM Research & Development Center
30500 Mound Road, Box 9055
Warren, Michigan 48090-9055

phone - (810) 986-1475 fax - (810) 986-9356 email - peruski++at++gmr.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:42 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.