SDL_Surface to opengl, transparency?

I use this function to convert an SDL_Surface to opengl, but I do not know
how to render the tranparency part of the image file, or how to set a pixel
value to transparent.
The SDL_SetColorkey function doesn’t seem to set the alpha channel to 0 for
a specific pixel, I do not know if this is a right way…

After that I do not really know how to activate transparency is opengl,
which function is most logical ? glBlendFunc or glAlphaFunc ?

int convert_surface( SDL_Surface *surface )
{
GLuint txid;

    // new dimensions
int w = power_of_two( surface->w ); // function from SDL_ttf, glfont.c
int h = power_of_two( surface->h );

SDL_PixelFormat *pixf = SDL_GetVideoSurface()->format;
SDL_Surface *image = SDL_CreateRGBSurface( SDL_SWSURFACE, w, h, 32,

pixf->Bmask, pixf->Gmask, pixf->Rmask, pixf->Amask );

SDL_BlitSurface( surface, NULL, image, NULL );

GLuint objet;
glGenTextures( 1, &txid );
glBindTexture( GL_TEXTURE_2D, txid );

glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA, image->w, image->h, 0, GL_RGBA,

GL_UNSIGNED_BYTE, image->pixels );

SDL_FreeSurface( image );
return txid;

}