I want to realize a exact copy of a region in a surface

I have a problem, i need to split a surface in power of two size
surfaces for have used in opengl. The problem is that i don’t know how
to obtain a exact copy of a region surface in a new surface (with the
same alpha format, pixel format,etc), i have used SDL_CreateRGBSurface,
SDL_CreateRGBSurfaceFrom, but this functions don’t respect the alpha
channel, anybody can help me?.

—Publicidad--------------------------------------------------------
Juega con Ventura24.es, loter?a inteligente y multiplica tus
posibilidades!! http://www.iespana.es/_reloc/email.ventura

Sefra at iespana.es wrote:

I have a problem, i need to split a surface in power of two size
surfaces for have used in opengl. The problem is that i don’t know
how to obtain a exact copy of a region surface in a new surface (with
the same alpha format, pixel format,etc), i have used
SDL_CreateRGBSurface, SDL_CreateRGBSurfaceFrom, but this functions
don’t respect the alpha channel, anybody can help me?.

Disable alpha on the source surface (see the SDL_SetAlpha manpage)
before doing the blit, and it will transfer the alpha channel during the
blit.

Stephane