Removed unnecessary settings window state variable
Moved glUseProgram() call further down in the sequence of gl calls