From: Paolo Farinelli (paolo++at++sgi.com)
Date: 04/07/2003 13:11:23
Hi,
A third option could be that of creating your gl-texture as a pfTexture,
and in your callback. replace your call to glBindTexture(..,gl_tex) with
a call to pf_tex->apply().
Paolo
Yair Kurzion wrote:
>Hello Steve !
>
>Performer maintains an internal copy of the OpenGL state. It doesn't know that
>you changed the current texture. When you call pfTexture::apply, it checks its
>internal state and finds that this texture is already bound (and skips the
>apply).
>
>In general, if you tweak OpenGL state without Performer's knowledge, you
>have to restore state to what Performer left it.
>
>I can think of two ways to fix this problem:
>
>o Restore the Performer texture:
>
> // Check current Performer texture.
> pfTexture *curTexture = pfGetCurTex();
>
> glBindTexture(GL_TEXTURE_2D, ogl_tex);
>
> ... Your rendering code here ...
>
> // Restore OpenGL state.
> glBindTexture(GL_TEXTURE_2D, curTexture -> getGLHandle());
>
>o Define another texture, foo. Before you call texture->apply, call
> foo->apply. This will cost you an extra texture bind but should modify
> the internal Performer state so that texture->apply will really apply it.
>
>
>-yair
>
-- Paolo Farinelli paolo++at++sgi.com Member of Technical Staff, OpenGL Performer 1-650-933-1808 Silicon Graphics 1600 Amphitheatre Pkwy, Mountain View, CA 94043
This archive was generated by hypermail 2b29 : Mon Apr 07 2003 - 13:11:28 PDT