Problems with pfTexture::subload()

New Message Reply Date view Thread view Subject view Author view

From: Sergio Casas Yrurzum (sergiocy++at++arrakis.es)
Date: 04/13/2001 03:59:25


Hello,
first of all, many thanks to Stephane Jaeger and Angus Dorbie who helped me
to capture the framebuffer. Unfortunately, I have another problem..., so I
hope you can help me again, please.

Well, my problem now is that I can't capture more than 256x256 pixels of
the framebuffer with the subload() function.

In order to make me understand, I'll show a piece of my source code:

..
..
..
pfTexture *texture;

int main()
{
...
...
...

    texture = new pfTexture();
    unsigned int *image;

    int sizeTex = 1024;
    image = (unsigned int *)pfMalloc(sizeof(unsigned
int)*sizeTex*sizeTex,pfGetSharedArena());

    texture->setFormat(PFTEX_EXTERNAL_FORMAT,PFTEX_PACK_8);
    texture->setFormat(PFTEX_INTERNAL_FORMAT,PFTEX_RGBA_8);
    texture->setFormat(PFTEX_IMAGE_FORMAT,PFTEX_RGBA);
    texture->setLoadMode(PFTEX_LOAD_SOURCE,PFTEX_SOURCE_IMAGE);
    texture->setName("Frame Buffer Texture");
    texture->setImage(image,4,sizeTex,sizeTex,1);
    texture->setLoadOrigin(PFTEX_ORIGIN_SOURCE, 0, 0);
    texture->setLoadOrigin(PFTEX_ORIGIN_DEST, 0, 0);
    texture->setLoadSize(sizeTex, sizeTex);
    texture->setFormat(PFTEX_SUBLOAD_FORMAT, PF_ON);
    texture->setFilter(PFTEX_MINFILTER, PFTEX_BILINEAR);
    texture->setFilter(PFTEX_MAGFILTER, PFTEX_BILINEAR);

    texture->apply();
    texture->format();
    texture->load();

    texture->setLoadMode(PFTEX_LOAD_SOURCE, PFTEX_SOURCE_FRAMEBUFFER);

...
...
...
...

}

static void travOriginalChan(pfChannel *chan, void *)
{
    // draw call-back function of the original channel

    chan->clear();
    pfDraw();

     texture->subload(PFTEX_SOURCE_FRAMEBUFFER,
                              NULL,
                              0,0, /* Source origin */
                              0, /* ???? */
                              0,0, /* Destination origin */
                              1024,1024 /* Subload size */
                              );
}

static void travDistortedChannel(pfChannel *chan, void *)
{
    // draw call-back function of the distorted channel

     chan->clear();
     pfDraw();
}

If I change the last two values of the subload() call to ...256,256)
everythings works OK, but with ...512,512) or ...1024,1024) it doesn't
work (no subload is made).

By the way, can anyone explain me what means the 5th argument of subload() ?
Whatever I put there, it seems to be ignored...

My window has a 1024x1024 size, and if I made a getImage() before the
subload(), I read this:

   comp = 4
   s = 1024
   t = 1024
   r = 1

so it seems the size of texture is not the problem.

Does anyone know what the hell is happening??

Thanks, and sorry about my terrible english!!!


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Apr 13 2001 - 03:58:18 PDT

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