You are not logged in.

#1 2008-08-24 11:06:19

JyCet
Member

how to copy one texture to another one

Hi all,
I would like to create a fake framebuffer with a simple texture, where I can copy all my gfx, because some gfx dont need to be copied all the times and also because I would like to use texture zoom function to resolve tv overscan probleme.

background -> fakebuffer
shadow -> fakebuffer
sprite -> fakebuffer

fakebuffer -> framebuffer with zoom

Any help are welcome, thanks in advance smile

Offline

 

#2 2008-08-25 16:51:41

Crayon
Bad Mother Fucker

Re: how to copy one texture to another one

Maybe what you are looking for is in that post: http://grrlib.santo.fr/forum/viewtopic.php?id=35

Offline

 

#3 2008-08-31 21:41:07

JyCet
Member

Re: how to copy one texture to another one

Thanks for your tips,
I was used

Code:

/**
 * Make a snapshot of the sreen in a texture.
 * @return A texture representing the screen.
 */
u8 *GRRLIB_Screen2Texture() {
    void *my_texture;

    GX_SetTexCopySrc(0, 0, 640, 480);
    GX_SetTexCopyDst(640, 480, GX_TF_RGBA8, GX_FALSE);
    my_texture = memalign(32, 640 * 480 * 4); // GX_GetTexBufferSize(640, 480, GX_TF_RGBA8, GX_FALSE, 1)
    GX_CopyTex(my_texture, GX_FALSE);
    GX_PixModeSync();
    return my_texture;
}

with

Code:

tex_scrTmp = GRRLIB_Screen2Texture ();

the logic is more complicate smile
draw background -> frame buffer
draw shadow -> frame buffer
copy frame buffer -> tmptexture
finally use tmptexture
smile

Is the library alive ? There re a lot of nice contributions on this forum !
It will be good to add it and support it in official release.

Offline

 

#4 2008-09-09 15:58:57

JyCet
Member

Re: how to copy one texture to another one

A little bump to tell this function copy the "undisplayed" frame buffer

use it after the GRRLIB_Render(); give a black screen

It's pity to capture the current video displayed and make a fadeout wink

Offline

 

Board footer

Powered by FluxBB