changing texture image

New Message Reply Date view Thread view Subject view Author view

AnitaKishore (kishore++at++electrogig.com)
Tue, 9 Apr 1996 19:20:05 -0700


I am trying to change a pfTexture's image during run time and facing
the following problem:

        Since the new image file (.rgb) may not match in format to the
already loaded image, I do the following in APP:

        uint *image = NULL;
        int comp, ns, nt, nr;

        // assume I have the proper "originalTex"

        pfTexture *tempTex = pfNewTex(pfGetSharedArena());
        pfLoadTexFile(tempTex, newImageFile);
        pfGetTexImage(tempTex, &image, &comp, &ns, &nt, &nr);
        pfFreeTexImage(originalTex);
        pfTexImage(originalTex, image, comp, ns, nt, nr);
        pfTexName(originalTex, newImageFile);
        pfFree(tempTex);

The texture attributes are set to the new ones properly. I have checked this
by getting tex image after each change. But the render area doesn't show the
proper change. I can see the new image, but without any color - I guess the
formatting is wrong. How can I correctly set the new image to the pfTexture
type "originaltex"? Do I need to do something in DRAW process?

BTW: the old image and the new image don't have the same format. The old one
is RGBA (which gets loaded in through the iv loader). The new image is RGB
which I am trying to set as above.

Any help would be greately appreciated.

thanks
-anita

-----------------------------------------------------------------
Anita Kishore
kishore++at++electrogig.com
-----------------------------------------------------------------


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:52:41 PDT

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