   SDL - problem: surfaces have no color
  I hope someone here can assist me with this problem:I am using SDL in a C++ program. I call SDL_CreateRGBSurface() to create a surface of certain dimensions and a certain color. However, the surface shows up on the screen black, no matter what the R, G, and B values are. It used to show up in color, so I probably made a goof somewhere. When I assign a surface by loading an image from a file, it works fine, but not on the "primitive" way of constructing surfaces. What are all the possible causes of this bug? Here's the call:picture = SDL_CreateRGBSurface( SDL_SWSURFACE, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_BPP, 0x90, 0, 0xFF, 0 );A twist is that it shows up completely invisible if both the alpha and any of the RGB values are greater than 1. I'm not sure if this helps, because I've never bothered with the alpha value.EDIT: SCREEN_BPP is 32.   
  SDL_CreateRGBSurface doesn't create surfaces of a given colour. It creates blank surfaces of a given format. The last 3 parameters are bitmasks, specifying where the colour is stored within the pixel - in your case, noting which of your 32 bits are allocated to red, green, and blue respectively.   ;  Thanks for pointing that out to me! I should use SDL_FillRect() to color the surface. Thanks a lot.   