From Wang Rui with edits from Robert Osfield, additional GLenums for cross platform build