Closed matus-chochlik closed 11 years ago
The detection of GL version supported by the library that provides GL API (for example GLEW) has been added to the build system.
It is a bit o' buggy. It says I have OpenGL 4.3 while my hardware is only capable of ogl 3.3, so it includes wrong headers, tries to build tutorials that it shouldn't and basically floods with error messages upon build. Unless I manually specify the max OpenGL version when running the configure.py. I think Windows users without too much command line experience could have some trouble with it.
The current method of GL version detection is rather rudimentary and therefore not 100% reliable. Detecting the supported version reliably would require checking if everything is according to the specification which is a quite difficult task. I'll reopen this issue, but getting it done will take some time.
I don't actually understand the method you are checking the OpenGL version, but extension loaders seem to have quite reliable method for doing this, at least for me, they report good version numbers. For ex: GLEW: if (!GLEW_VERSION_4_1) GL3W: if (!gl3wIsSupported(4, 1)) GLLoad: if (!glload::IsVersionGEQ(4, 1))
Right now the only thing that is checked is what the 'GL header' reports i.e. whether GL_VERSION_X_Y is defined. You could use GLEW/GL3W/etc. or even use oglplus::Context::VersionMajor() and VersionMinor(), but GLEW & co. may not be available everywhere, and also it requires an initialized GL context to work properly and I've seen instances when the returned version was not correct. Furthermore whatever method of version detection you use you have to integrate it into the cmake build-system. It is doable, but not trivial. I have this thing on the TODO list and I've been doing some changes to the build system recently so I'll probably have a look at this.
Now it works well on all the 3 PCs I've tried! Great job!
Unfortunately not really :) It is too strict now. I have several machines where 'technically' the version is only 3.3 but many of the 4.x examples compile and run OK thanks to extensions and with the new detection method these don't get built now. I'll have to add extensions somehow and in the meantime I'll temporarily disable the strict version check. But stay tuned.
I've updated the detection of GL version + GL extensions and also the example dependencies (which still might not be 100% accurate) so it now should be more reliable. If anyone spots any problems related to this, please report them.
Examples (and test-modules?) should be built only if they use version less or equal than the detected version.