From: Gernot Ziegler (gz++at++lysator.liu.se)
Date: 10/30/2001 02:44:27
Hej Dimi !
> Hi,
> I am currently trying to find a way to do some procedural texturing,
> where I take the
> original texture change it in some way and the reapply it.
> I used for that the pfTexture::getImage/setImage methods:
>
> tex->getImage(&i, &nc, &sx, &sy, &sz);
> /*
> Here I modify the RGBA data using the i pointer
> */
> tex->setImage((uint*)ch,nc, sx, sy, 1);
>
> Is there a faster way to do this, ie. upload at runtime a texture. I was
> looking
> for a similar way to glTexSubImage2D in OpenGL, but I dont know if these
> methods
> have the same functionality.
Yes, it's possible - please have a look at
http://www.lysator.liu.se/~gz/storm.tar.gz
desert.cc contains some code in the callbacks (look for "subtexture")
that uses subtexture download to update the MPEG frames, and
init.cc (as far as I recall: CreateVideoPlanes) shows you how to
activate the subload feature (it's an attribute).
(This is preview code - nothing is guaranteed to be working, and it is
long from being compilable if you don't have a bunch of strange libs
installed ;) )
Servus,
Gernot
/-----------------------------W-E-L-C-O-M-E------------------------------\
T The Austria <=> Sweden connection..... T
| E-Mail: gz++at++lysator.liu.se H
O Homepage: http://www.lysator.liu.se/~gz E
\------------------------------F-U-T-U-R-E-------------------------------/
This archive was generated by hypermail 2b29 : Tue Oct 30 2001 - 02:42:26 PST