Polytonic / Glitter

Dead Simple OpenGL
http://polytonic.github.io/Glitter/
2.48k stars 418 forks source link

Automatically detect correct OpenGL version. #28

Closed matthewjberger closed 8 years ago

matthewjberger commented 8 years ago

This change will try the different versions of OpenGL working backward from 4.5 to find the correct OpenGL version for the system the sample is being run on. When I built Glitter on my laptop that uses OpenGL 3.3 core, the example program did not run. For a beginner it may not be clear to why the sample wasn't working, and they wouldn't necessarily know how to correctly set the version to match their system.

Polytonic commented 8 years ago

Hi there! First off, sorry for the delay. I wanted to make sure I had time to sit down and write a full response. Onto business then: thank you for the pull request, but I'm afraid I must decline this one. I want to keep the code as barebones as possible.

If the project doesn't build or run, I'd rather someone open an issue, rather than have people "run more code in their head" so to speak. Knowing which OpenGL version your binary is running is important for understanding which GL features are available. Automatically detecting the highest compatible GL runtime is great for production and certainly convenient, but not always great for learning or debugging.

On the same note: I also want to maintain (code) parity with the two main tutorials that link to this project.

If you feel strongly about this, feel free to respond, and we can discuss this further. 😄