[info-performer] Rendering to multiple windows

New Message Reply Date view Thread view Subject view Author view

From: Markus Priglinger (mp++at++gup.uni-linz.ac.at)
Date: 07/03/2002 09:48:17


Hi Performers,

I have a pfPipeWindow (the 'main' window) with a pfChannel attached to it.
Later (main window is open), a pfWindow (win2) is attached to the main
pfPipeWindow.
I want to render into both windows using my channel callback function.

Problem: The main window will be rendered correctly, the second remains
unchanged.
Overlay window should be avoided, only one channel should be used (both if
possible).

Code looks like this:

// shared: pfPipeWindow* winMain; pfWindow *win2; ...

// winMain already configured and channel attached
shared->winMain->open();

// attach draw callback to winMain
shared->channel->setTravFunc(PFTRAV_DRAW, drawChannel);

// create second win
shared->win2 = new pfWindow();
shared->win2->setWinType(PFPWIN_TYPE_X);
shared->win2->->setOriginSize(oriX, oriY, resX, resY);
shared->win2 = new pfWindow();

pfList *winList = new pfList();
winList->add(shared->win2);
shared->winMain->setWinList(winList);

shared->win2->open();
.
.
pfFrame();

// -----------

// callback function
void drawChannel (pfChannel *, void *) {

    // draw to MAIN window

    shared->winMain->setIndex(PFWIN_GFX_WIN);
    shared->winMain->select();

    glClearColor(0.0f, 0.4f, 0.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    pfDraw();

    // select SECOND window and render to it

    shared->winMain->setIndex(0);
    shared->win2->select();

    glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    pfDraw(); // once again

}

Windows but the background should look the same,
don't know why only main window looks fine.
I'm running Linux Redhat 7.2 and Performer 2.5.1
Any suggestions on how to solve these problems?
Thanks.

--------------------------------------------------------

Dipl.-Ing. Markus Priglinger
VR/Graphics Programmer

Department of Graphics and Parallel Processing (GUP)
Institute of Technical Computer Science and Telematics

TNF-Tower, Room #627
Johannes Kepler University Linz
Altenbergerstr. 69
A-4040 Linz, Austria, EUROPE

Tel: +43 732 2468 8884
Fax: +43 732 2468 9496


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Jul 03 2002 - 09:50:48 PDT

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