Textured geosets in multiple windows

New Message Reply Date view Thread view Subject view Author view

AST (arnaud++at++thomson-dsi.fr)
Thu, 16 Jun 94 09:54:29 +0100


I seem unable to draw one textured geoset in 2 separate windows created by winopen. The call to
pfDrawGSet in the 1st window gives a correct result, but I get no texture in the 2nd window.
Any ideas ?

Here is one simple code that reproduces this bug:

void main( int argc,
           char *argv[] )
{
    pfGeoSet *gset;
    pfGeoState *gset_state;
    pfTexture *tex;
    pfTexEnv *tex_env;

    /* ----------------------------
        Initialization of Performer
       ---------------------------- */
    pfInit();
    arena = pfGetSharedArena();

    /* -----------------------
        Creation of one geoset
       ----------------------- */
    gset = build_gset();

    pfInitState(NULL);
    pfNewState();

    gset_state = pfNewGState(arena);
    pfGStateMode(gset_state, PFSTATE_ENTEXTURE, PFTR_ON);

    /* --------------------------------------------
        Creation of one pfTexture and one pfTexEnv
       -------------------------------------------- */
    tex = pfNewTex(arena);
    tex_env = pfNewTEnv(arena);
    pfLoadTexFile(tex, "image.rgb");
     
    pfGStateAttr(gset_state, PFSTATE_TEXTURE, tex);
    pfGStateAttr(gset_state, PFSTATE_TEXTURE, tex_env);

    /* ------------------------------------
        Creation of 2 windows with winopen
       ------------------------------------ */
    init_windows();

    /* ------------------------------------
        Drawing of geoset in first window
        --> correctly textured
       ------------------------------------ */
    winset(wid1);
    pfApplyTEnv(tex_env);
    pfApplyTex(tex);
    pfEnable(PFEN_TEXTURE);

    pfDrawGSet(gset);
  
    sleep(1);

    /* ------------------------------------
        Drawing of geoset in second window
        --> no texture !?
       ------------------------------------ */
    winset(wid2);

    pfApplyTEnv(tex_env);
    pfApplyTex(tex);
    pfEnable(PFEN_TEXTURE);

    pfDrawGSet(gset);

    sleep(10);
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:20 PDT

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