copied from the cocos2d-xna repo tests.