This template has been updated a lot in my Simple 2D library (S2DL) that you can find a link to somewhere else on this site.

I am bust getting S2DL 1.04 ready to release. Probably ready in about 2 weeks. It moves the game template into a class (sort of like delphis TApplication) which makes it easier to maintain and read.