Javier Abadia (jabadia++at++sfe.indra.es)
Tue, 24 Aug 1999 08:02:05 +0200
I'm trying to dynamically modify textures. I follow these steps:
pfTexture *tex = new pfTexture;
tex->loadFile("myFile.rgb");
tex->setLoadMode(PFTEX_LOAD_SOURCE, PFTEX_SOURCE_IMAGE);
Then, each frame I call this function (from APP):
void modify_texture(void)
{
static unsigned int *m_bits;
static int m_planes, m_width, m_height;
if(first_time)
{
tex->getImage(&m_bits, &m_planes, &m_width, &m_height, NULL)
}
...
do some modification on m_bits
...
tex->setLoadImage(m_bits);
}
I have two questions:
1. Does any of these pfFunctions need to be called in any special
process? I'm calling them in APP and seems to work fine.
2. In order to achive good performance, I understand that I should
minimize texture reformatting. Moreover, I would like to do
modifications
using 16 bit texels with 4 bits per component, which is the internal
texture format as well, isn't it?
How do I get pfTexture::getImage() return m_bits in that format?
I have tried using pfTexture::setFormat() but I think I don't understand
it very well. When should I call setFormat(), and what tokens should
I pass?
pfThank you!
-- Javier Abadia Miranda / Ingeniero en Informatica MADRID (SPAIN) / Especialista en Informatica Grafica
This archive was generated by hypermail 2.0b2 on Mon Aug 23 1999 - 23:07:05 PDT