   SDL_SetColorKey()
  I am using SDL for my game, and I've been working throught the SDl tutorials, and instead of just copying the tutorials, I've been setting up the code for my game, implementing classes and such as they are needed to support the graphics subsystem. Once the graphics are halfway decent, I'll move on to expanding the game logic, etc. First, less important question: Is this a wise way to learn the basics of SDL? It has worked so far.Anyway, While doing all this, I came to a problem. The  sprite I'm trying to draw will draw to the screen, but it won't draw with a colorkey. Its just the white background I used for the sample sprite.  Here is the relevant portion of the loader function:class module{    int x;    int y;    sprite image;    public:    int draw();    int mx() {return x;}    int my() {return y;}    sprite mimage() {return image;}    module();};module::module(){    image = drawGetImage("command.bmp");    x = 200;    y = 200;    return;}sprite drawGetImage(string name){    sprite graphic;    imageRecord *current;    SDL_Surface *image;    Uint32 colorkey;    if (firstImRec == NULL && lastImRec == NULL)    {   image = SDL_LoadBMP(name.c_str());   if (image == NULL)   {  cerr<<"Failed to load bitmap:"<<SDL_GetError()<<endl;   }   image = SDL_DisplayFormat(image);   if (image == NULL)   {  cerr<<"Failed to convert bitmap:"<<SDL_GetError()<<endl;   }   graphic.image = image;   colorkey = SDL_MapRGB(graphic.image->format,0,0,0);   if (SDL_SetColorKey(graphic.image, SDL_SRCCOLORKEY, colorkey)==-1)   {  cerr<<"Error Setting color key in"<<name<<':'<<SDL_GetError()<<endl;   }   current = new imageRecord(name,graphic.image);   firstImRec = current;   lastImRec = current;   return graphic;    }Since this is the only part of drawGetImage that matters(I only need one sprite, at present), I truncated it.Heres the display function:int drawModule(module m){    SDL_Rect dst;    SDL_Rect src;    sprite target =  m.mimage();    dst.x = m.mx()-((target.image->w)/2);    dst.y = m.my()-((target.image->h)/2);    src.x = 0;    src.y = 0;    src.w = target.image->w;    src.h = target.image->h;    SDL_BlitSurface(target.image,&src,screen,&dst);}
  Didn't read all of it but if you get a white background, you should set the colorkey to white instead of black.colorkey = SDL_MapRGB(graphic.image->format,0xff,0xff,0xff);   ;  D'oh!I feel stupid now....