Modifications to allow multisampling antialiasing. Pass the number of samples into the createContext method.