title: Transparent SDL_Surface without background
body: <p>I'm working with SDL and OpenGL.
  I'm using SDL ttf for create a surface with the text, then create a texture with that surface.</p>
  
  <p>I'm trying to apply an alpha channel (opacity) to the text, I'm using this way:</p>
  
  <pre><code>    SDL_Surface * fontsurf = TTF_RenderUTF8_Blended(font,buff_split.at(i).c_str(),color);
  SDL_PixelFormat *format = fontsurf-&gt;format;
  SDL_Surface* newSurface = SDL_CreateRGBSurface( SDL_SRCALPHA,
     fontsurf-&gt;w, fontsurf-&gt;h, 32,
     0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 );
  
  
      Uint32 alpha = 0;
      alpha = SDL_MapRGBA( newSurface-&gt;format, 0,0,0, color.unused);
  
      SDL_Rect rect;
      rect.x = 0;
      rect.y = 0;
      rect.h = fontsurf-&gt;h;
      rect.w = fontsurf-&gt;w;
      int ret = SDL_FillRect( newSurface, &amp;rect, alpha);
  
      SDL_SetAlpha(newSurface,SDL_SRCALPHA,SDL_ALPHA_TRANSPARENT);
  
      ret = SDL_BlitSurface( fontsurf, 0, newSurface, 0 );
  </code></pre>
  
  <p>The opacity is applied correctly, but the SDL_MapRGBA creates a black background in the "newSurface".
  How can I apply alpha/opacity to the text, without adding a background, only the text?</p>