SDL_FillRect uses x,y,w,h, but you're using the x2 and y2 values from boxColor instead of w and h. As for boxColor not working, try making sure that you're not drawing off the edge of the screen (can't remember if boxColor likes that or not), and I don't have time to read through and find out...