Re: OpenGL graphics state during draw callback
Angus Dorbie (dorbie++at++multipass.engr.sgi.com)
Wed, 27 Aug 1997 23:28:15 -0700
On Aug 27, 2:07pm, Richard Rabbitz wrote:
> Subject: OpenGL graphics state during draw callback
>
> Hi Performers,
>
> We have an application where we need to customize channel drawing to include
> some OpenGL calls. I know this must be done in the DRAW process since this
> is the only place to get a handle to a graphics context. When we enter the
> draw process we draw the scene graph (which renders correctly), but then when
> we try to make some render call in OpenGL it seems as though the projection
> and model matrix stacks are not retained from the channel setup, so we have
> to go and set these again in OpenGL to ensure the proper view transformation
> for our OpenGL rendering. So my question is: In the draw callback does the
> graphics context we are handed retain any state from the channel call made
> previously? Or, do we have set the view transformation explicitly every time
do
> OpenGL rendering?
It depends where you insert the callbacks.
In the channel draw callback where you clear and call pfDraw you
won't have a suitable modelviewing matrix, however in node callbacks you
do, so if you need the viewing transform the simplest way could be
to add a callback to an unculled scene graph node with pfNodeTravFuncs
or C++ equivalent. You can use bins to order the rendering.
Cheers,Angus.
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2
on Mon Aug 10 1998 - 17:55:47 PDT