Fix compiling with the the --gles option on the AMD OpenGL ES2 SDK.

Just some #ifs moved around for the most part.