Added explict setting of the PolygonMode to over the distion mesh being toggled to wireframe.
Removed -fpermissive flag from GCC build, and fixed warning