From: Allan Schaffer (allan++at++sgi.com)
Date: 03/09/2000 16:29:29
Hi Scott,
On Mar 9, 4:56pm, Scott Herod wrote:
> I have a couple of question regarding when it is possible to call
> glEnable(). I want to enable the stencil test and keep it enabled.
> Apparently glEnable() must be called in a draw callback to take effect.
> I've tried calling it after pfInit() and prior to pfConfig() without
> having stencil testing take effect. Is this what I should expect?
The distinction about where it's OK or not OK to make OpenGL calls
comes down to: which [unix] process has the OpenGL context?
In multi-process Performer apps only the Draw process has the OpenGL
context so draw-process callbacks are the only safe place to make
OpenGL calls. (Not the APP, not the CULL, etc).
In single-process Performer apps the App, Cull, and Draw are all done
in the same actual [unix] process (by definition) so practically
speaking OpenGL calls can be made anywhere in any of those, except
you need to wait for Performer to set up its OpenGL context first.
But having wayward OpenGL calls sprinkled around in the APP or CULL
is a bad practice to undertake, since the program will be unable to
ever run MP.
> Second,
>
> pfInit();
> glEnable( GL_STENCIL_TEST );
> pfConfig();
>
> core dumps on the pfEnable() in performer for linux but runs ok in
> IRIX even if the glEnable() has no effect. ( Placing the glEnable
> in a draw callback works fine on both. ) Can someone suggest why
> it is different on Linux?
At that point the OpenGL context & window haven't been created. I'm
a bit suprised it doesn't fail on IRIX, but it's definitely wrong to
make the call there. Put it in a draw callback instead..
Allan
-- Allan Schaffer allan++at++sgi.com Silicon Graphics http://reality.sgi.com/allan
This archive was generated by hypermail 2b29 : Thu Mar 09 2000 - 16:29:34 PST