matus-chochlik / oglplus

OGLplus is a collection of open-source, cross-platform libraries which implement an object-oriented facade over the OpenGL® (version 3 and higher) and also OpenAL® (version 1.1) and EGL (version 1.4) C-language APIs. It provides wrappers which automate resource and object management and make the use of these libraries in C++ safer and more convenient.
http://oglplus.org/
Boost Software License 1.0
491 stars 72 forks source link

cmake can't find opengl version, assumes 3.0. but my glxinfo says i have opengl 4.3 #26

Closed ghost closed 10 years ago

ghost commented 10 years ago

Hello,

when building oglplus it says: "can't get opengl version, assuming 3.0", problem with that is that a lot of examples don't get built after because it says certain extensions aren't setup properly (that require 3.0+). i tried setting --max-gl-version 4.3 but that didn't work. is there a --min-gl-version?

here's my glxinfo | grep OpenGL output: OpenGL vendor string: Advanced Micro Devices, Inc. OpenGL renderer string: AMD Radeon(TM) HD 6480G OpenGL core profile version string: 4.3.12438 Core Profile Context 13.20.5 OpenGL core profile shading language version string: 4.30 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 4.3.12438 Compatibility Profile Context 13.20.5 OpenGL shading language version string: 4.30 OpenGL context flags: (none) OpenGL profile mask: compatibility profile OpenGL extensions:

i'm using glfw3 for context creation, since glfw3 changed a few things from version 2 (i had to edit FindGLFW.cmake for it to work) maybe that's what causing not getting the right opengl version?

thanks in advance.

matus-chochlik commented 10 years ago

There was a bug in the detection code that manifests itself if glut is not installed. It was fixed in commit a9af17fe9fd57de80845579f4572f9e8e05ce5de. Could you pull from develop and test if that fixes this problem? B.T.W. the '--strict-gl-version-detection=0' option passed to configure.py bypases the strict version detection and runs only a simple try_compile test.

HTH

matus-chochlik commented 10 years ago

OK, I've fixed some other problems and added support for GLFW3. Since commit dcfeb61e3cb9ccf8079874173452fdb611505236 the build system should be able to detect glfw3 correctly and there is a new example harness for this new version of GLFW. Please let me know if the new functionality works for you.

ghost commented 10 years ago

hey, thanks for the replies and changes.

so, after your first reply opengl detection worked fine (using glx, detected opengl 4.4) and a lot more samples compiled, but a few using ARB_tesselation didnt which is fine for me since im not getting into tesselation anytime soon. today using --use-glfw3 worked fine but couldnt detect opengl again and assumed 3.0 (even with using --use-glx)

btw thanks so much for this library, kinda hard to go back to GLuint's and glFunctionName after starting using this library :p

matus-chochlik commented 10 years ago

Thanks :) I'm testing the new changes on various machines and on some of them there are problems. hopefully I'll have them fixed soon.

matus-chochlik commented 10 years ago

B.t.w. is your GLFW3 installed in one of the system include directories or somewhere else and do you have just libglfw3.so or just libglfw3.a or both ?

ghost commented 10 years ago

i'm using glfw3 on a custom folder, because on linux mint repositories theres only glfw2 for now. both .a and .so versions are on that folder

i use -L and -I for the configure script to find it: python configure.py -L path/to/glfw3/lib -L path/to/glew/lib -I path/to/glfw3/include -I path/to/glew/include -I path/to/glm/include --use-glew --use-glfw3

matus-chochlik commented 10 years ago

okay, could you please do the following?

1) Add "exit()" to the end of ./config/GLver.cmake 2) run configure as you do but with the additional --debug-config argument 3) when it fails at the "exit()" statement go to ./_build/gl_ver/CMakeFiles/CMakeTmp 4) execute make and have a look at or post here the output to see why it failed?

TIA

ghost commented 10 years ago

sorry i took so long to reply.

so i tried that but no folder named "gl_ver" was created, the only ones inside build are: CMakeFiles, cpp11, ext_lib

i ran make in every CMakeTmp inside those folders:

but no gl_ver folder. i followed the instructions as such:

matus-chochlik commented 10 years ago

In the meantime I've made some changes and merged the gl_ver and gl_ext folders into ./_build/gl/ so now it's 'gl' but it's strange that it was not created. I've tested the latest version on 6 different machines both windows and linux and everywhere it works fine. Anyway does the problem with GL version detection still occur?

matus-chochlik commented 10 years ago

b.t.w. do you have the pkg-config file for glfw3 ? and is so do you have PKG_CONFIG_PATH updated so that pkg-config can find it ? i.e. does 'pkg-config glfw3 --libs' or 'pkg-config glfw3 --libs --static' print anything ?

ghost commented 10 years ago

hey,

so i just go home and tried the last commit and everything worked just fine. found glfw3, detected opengl 4.4 and every single example compiled, good stuff :)

thanks a lot for the help!

matus-chochlik commented 10 years ago

No problem, thanks for reporting this :)