Allan Schaffer (aschaffe++at++shark.paris.sgi.com)
Thu, 16 Mar 1995 19:36:29 +0100
For this to work you'll need to move the calls to qdevice (and any
other GL calls) into a callback to be called by the Draw process.
Here's a better description from the FAQ:
Subject: -15- How do I make GL calls from within a IRIS Performer program?
Date: 26 Oct 93 00:00:01 EST
GL calls can only be made from a process that has a GL context. In
multi-process Performer applications only the draw process has GL
context, so you must make your GL calls in a function called in the
draw process.
The pipe initialization callback, draw function callback, and node
draw callbacks are all executed in the draw process.
In an application that only will ever run single-process, GL calls
can be made from anywhere in the program.
To set up a pipe initialization callback, see the pfInitPipe() man page.
To set up a draw function callback, see the pfChanDrawFunc() man page.
To set up a node draw callback, see the pfNodeTravFuncs() man page.
Allan
On Mar 16, 6:56pm, abrend++at++idt.unit.no wrote:
>
> I'm stuck! I have written a simple viewer using Performer and GL
> routines. These was written on an Indigo with Performer 1.2 and IRIS
> 5.3. Now I got to use an Onyx RE2 and my viewer stopped running. I
> think I'm doing something wrong when reading the input devices (mouse
> and keyboard). My app. runs just fine on the Indigo. What I do is
> this :
>
> qdevice(RIGHTMOUSE);
> qdevice(WINQUIT);
> qdevice(LEFTARROWKEY);
> qdevice(RIGHTARROWKEY);
> qdevice(DOWNARROWKEY);
> qdevice(UPARROWKEY);
> qdevice(PAGEUPKEY);
> qdevice(PAGEDOWNKEY);
> qdevice(HOMEKEY);
> qdevice(PADPLUSKEY);
> qdevice(PADMINUS);
> qdevice(PKEY);
>
> while (!done)
>
> {
> /* Go to sleep until next frame time. */
> pfSync();
>
> while (qtest())
> {
> short arg;
> switch (qread(&arg))
> {
> case (PAGEUPKEY):
> zDirection += step;
> break;
>
> case (PAGEDOWNKEY):
> zDirection -= step;
> break;
>
> .......
>
> }
> }
> }
>
> Do anyone do something similar ? What could be wrong ?
-- Allan Schaffer Silicon Graphics aschaffe++at++sgi.com http://reality.sgi.com/employees/aschaffe
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:05 PDT