I don't see anything that you're doing wrong. And I don't have OpenGL so I can't run your program. If you provide me a location for the version of the OpenGL I can see how it performs. Also...