[info-performer] glBindTexture overrides pfTexture

New Message Reply Date view Thread view Subject view Author view

From: Stephen Jeffrey (Stephen.Jeffrey++at++maths.uq.edu.au)
Date: 04/06/2003 23:37:25


Hi,

I have a draw callback specified on a geode. The
callback binds to an OpenGL texture object and
then draws some geometry. The callback returns
and the geode is then drawn. The problem is the
geode is drawn with the OpenGL texture, not
the pfTexture specified on its geostate ie. the
OpenGL texture seems to override the pfTexture.

int pre_draw_callback(pfTraverser *trav, void *data)
{
   glBindTexture(GL_TEXTURE_2D, ogl_tex);
   
   ... draw some geometry, textured with "ogl_tex" ...

   // Try to switch back to the pfTexture
   pfGeode *node = (pfGeode *)trav->getNode();
   pfGeoSet *geoset = node->getGSet(0);
   pfGeoState *gstate = geoset->getGState();
   pfTexture *texture = (pfTexture *)gstate->getAttr(PFSTATE_TEXTURE);
   texture->apply();
}

   ... then draw the geode ...

int post_draw_callback(pfTraverser *trav, void *data)
{
   ... clean up ...
}

I have tried using pfTexture::apply() in the callback
to switch back to the pfTexture after I'm finished
with the OpenGL texture object, but it has no effect.

Any ideas?

cheers
steve


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sun Apr 06 2003 - 23:40:26 PDT

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