That's backwards. You need to set a color depth before setting a graphics mode. Also, 24-bit is not a good color to use. Generally you should use the desktop color depth desktop_color_depth() 32- or 16-bit. 8-bit shouldn't be used unless your game is specificly designed for it.
This has nothing to do with your problem, but I just like to point out to everyone who makes the mistake, that END_OF_MAIN(); is wrong. It should be just END_OF_MAIN() without the ; at the end.