Properly restore all the OpenGL states properly and added a sanity check.

Also set the proper viewport value at startup.
Merge pull request #27 from Orphis/viewportfix

Properly restore all the OpenGL states properly and added a sanity check
Bugfix LoggingDeadline
Don't try to register/unregister too early.
Port to Pandora. Thanks to ptitSeb.
Merge pull request #28 from xsacha/pandora-port

Port to Pandora.
Add names to the magic numbers of left joystick input (Qt/Blackberry).