New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dynamic configuration requirement #89
Comments
For C++ features this can be done and it is done by using the Boost.Config library. You just have to define The tricky part is the detection of available OpenGL version / extensions and right now I don't see how this can be done reliably without compiling and running a couple of test programs. Because of that the CMake config detects what really is available and then generates the |
I'll have to take a look at the I see the
|
The Boost.Config library is quite lightweight and I'm considering that I'll start distributing it with OGLplus source in the Concerning the Using the build system is generally not a requirement for using OGLplus in applications (especially with modern compilers) and it is there mostly to ensure that the examples which can be built do build without errors. |
I tried grabbing the boost config code and replacing the config stuff with this:
But I get a ton of build errors inside the oglplus headers. I'll try to narrow down the exact cause. The Boost config headers are definitely getting included (I tried putting some |
Could you paste here/somewhere the output of make? |
Here's the output of compiling a small C++ file: the file consists of the following:
|
You don't include any 'GL library' like |
I was attempting to create a 'minimal example' but I think I over-minimized it. In my full code I do include GLEW before the oglplus stuff, but I don't think I'm setting the OGLPLUS_USE_GLEW in the test I'm doing. will try. |
OK, adding OGLPLUS_USE_GLEW and the glew header makes it compile (on my mac at least, with mac specific changes to the main decl). It would be helpful if in the absence of any GL header if oglplus emitted a #warning or #error to let the developer know. The error output wasn't really leading me anywhere but to preprocessor macros that seemed to be related to C++ feature detection. |
Ugh... nope, still not compiling on Windows. I've winnowed my test file down to this:
And the output I get is here: https://gist.github.com/jherico/3ae4124e00a6f4369076 I'm using Visual Studio 2013 Community edition, commit 6a48fc4 from oglplus and the boost config headers from a just downloaded version of boost. If I explicitly add the following defines it compiles:
So it seems like either the boost config is misidentifying the support for these items, or OGLplus is using the features in some way that's not actually compliant, or possibly that VS2013's implementation is non-compliant. |
Well, MSVC 'sort of' supports these features, but the implementation is horribly broken (at least in MSVC 2012 and older, I didn't try MSVC 2013 yet). I'm fairly certain that the lines that the MSVC complains about are valid, standard C++ and both g++ and clang++ compile them without warnings even in pedantic mode. So until Microsoft fixes these problems you probably need to set the macros manually, if Boost (IMO incorrectly) reports these features as supported. |
Yeah, here's the line:
|
Yes and the other errors in the output come from bugs in the implementation of variadic templates. |
OK, I've updated |
I really like oglplus' utility as a header only library, but I find it frustrating that configuration step is necessary, especially when I'm working with a project where I'm including oglplus as a submodule. I don't want to configure my CMake to recursively call cmake for oglplus. Currently to get around this I have to trick my cmake into running the required static config by changing the project root temporarily ( see https://github.com/jherico/OculusRiftInAction/blob/master/CMakeLists.txt#L125 )
It would be a lot simpler (for library users granted, not the library maintainer) if oglplus used compiler identification and versioning for determining the available feature set (similar to https://github.com/jherico/OculusSDK/blob/master/LibOVR/Src/Kernel/OVR_Compiler.h or https://github.com/g-truc/glm/blob/master/glm/detail/_features.hpp ). This issue actually blocked me from adopting oglplus much sooner than I did.
The text was updated successfully, but these errors were encountered: