Tgp

First attempt at removing c/c++ code mixing.
Ah yes I forgot this file in my list of places that have inconsistent code, I got this file from a teacher of mine in my intro graphics class and keep reusing it because it has some convenient error checking functionality. These are some very welcome (and needed) changes.