Toggle textures on/off

New Message Reply Date view Thread view Subject view Author view

From: Jürgen Gotschlich (juergen.gotschlich++at++dlr.de)
Date: 02/13/2002 15:11:32


High,

I would like to enable?disable all textures in my application. How to do
this ?
First I simply tried

        if( pfGetEnable(PFEN_TEXTURE)) pfDisable( PFEN_TEXTURE );
        else pfEnable( PFEN_TEXTURE );

But since this didn't work properly, I tried the following. The
'disable'-case is copied out of perfly and is working well. But the
'enable'-case (written by my own) is wrong. The textures are enabled,
but in wireframe. Why that ?

        if( TexMode ) {
          TexMode = FALSE;
          cout << "disable texture" << endl;
            pfOverride(PFSTATE_ENTEXTURE | PFSTATE_TEXTURE | PFSTATE_ENTEXGEN,
0);
            pfDisable(PFEN_TEXTURE);
            pfDisable(PFEN_TEXGEN);
            pfOverride(PFSTATE_ENTEXTURE | PFSTATE_TEXTURE | PFSTATE_ENTEXGEN,
1);
        }
        else {
          TexMode = TRUE;
          cout << "enable texture" << endl;
            pfOverride(PFSTATE_ENTEXTURE | PFSTATE_TEXTURE | PFSTATE_ENTEXGEN,
1);
            pfEnable(PFEN_TEXTURE);
            pfEnable(PFEN_TEXGEN);
            pfOverride(PFSTATE_ENTEXTURE | PFSTATE_TEXTURE | PFSTATE_ENTEXGEN,
0);
        }

Some ideas ?

-- 
________________________________________________________________________

Jürgen Gotschlich email: juergen.gotschlich++at++dlr.de __/|_ Phone: +49(531)295-3248/2778 /_/_/_/ Fax : +49(531)295-2640 |/ DLR

Deutsches Zentrum für Luft-und Raumfahrt | German Aerospace Center Institut für Flugsystemtechnik | Inst. of Flight Research Abt. Flugsimulation | Flight Simulation Dep. Lilienthalplatz 7 | Lilienthalplatz 7 D-38108 Braunschweig | D-38108 Braunschweig, Germany ________________________________________________________________________


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Wed Feb 13 2002 - 06:13:04 PST

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