Failed to obtain desktop OpenGL version

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Failed to obtain desktop OpenGL version

Postby jay74 » Sun Jan 07, 2018 20:08

Environment:

Code:

Code: Select all

CEGUI::OpenGL3Renderer& myRenderer = CEGUI::OpenGL3Renderer::bootstrapSystem();


Error:
CEGUI::RendererException in function 'void CEGUI::OpenGLInfo::initTypeAndVer()' (/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88) : Failed to obtain desktop OpenGL version.
terminate called after throwing an instance of 'CEGUI::RendererException'
what(): CEGUI::RendererException in function 'void CEGUI::OpenGLInfo::initTypeAndVer()' (/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88) : Failed to obtain desktop OpenGL version.


Include from header file:

Code: Select all

#include <epoxy/gl.h>


I'm new to CEGUI and Epoxy. I tried to follow the directions to getting a project up and running, but I am running into the above issue. I am very grateful for the exceptionally clear and concise tutorials and directions here. You guys are awesome. My problem is probably something trivial and simple. Thank you in advance for your assistance.

-Jay

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Sun Jan 07, 2018 20:23

I forgot to mention. I build CEGUI with the following options:

Code: Select all

cmake .. -DCEGUI_BUILD_RENDERER_OPENGL=OFF -DCEGUI_BUILD_RENDERER_OPENGL3=ON -DCEGUI_USE_EPOXY=ON -DCEGUI_USE_GLEW=OFF

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Sun Jan 07, 2018 20:28

Just in case this is helpful. Here is the output of the cmake to show what it was able to find and what it was not:

sudo cmake .. -DCEGUI_BUILD_RENDERER_OPENGL=OFF -DCEGUI_BUILD_RENDERER_OPENGL3=ON -DCEGUI_USE_EPOXY=ON -DCEGUI_USE_GLEW=OFF
CMake Deprecation Warning at CMakeLists.txt:6 (cmake_policy):
The OLD behavior for policy CMP0017 will be removed from a future version
of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.


-- The C compiler identification is GNU 7.2.1
-- The CXX compiler identification is GNU 7.2.1
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PCRE: /usr/lib64/libpcre.so
-- Found FREETYPE: /usr/lib64/libfreetype.so
-- Found MINIZIP: /usr/lib64/libminizip.so
-- Found PkgConfig: /bin/pkg-config (found version "1.3.12")
-- Checking for module 'fribidi'
-- Found fribidi, version 0.19.7
-- Found FRIBIDI: TRUE
-- Looking for iconv
-- Looking for iconv - found
-- Found OpenGL: /usr/lib64/libOpenGL.so
-- Found GLEW: /usr/lib64/libGLEW.so
-- Found GLM: /usr/include
-- Could NOT find GLFW (missing: GLFW_H_PATH)
-- Found GLFW3: /usr/lib64/libglfw.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found SDL2: /usr/lib64/libSDL2.so;-lpthread
-- Found SDL2IMAGE: /usr/lib64/libSDL2_image.so
-- Could NOT find DIRECTXSDK (missing: DIRECTXSDK_LIB_PATH DIRECTXSDK_H_PATH DIRECTXSDK_MAX_D3D)
-- Could NOT find D3DX11EFFECTS (missing: D3DX11EFFECTS_LIB D3DX11EFFECTS_H_PATH)
-- Found IRRLICHT: /usr/lib64/libIrrlicht.so
-- Could NOT find OGRE (missing: OGRE_LIB OGRE_H_PATH OGRE_H_BUILD_SETTINGS_PATH)
-- Found OIS: /usr/lib64/libOIS.so
-- Could NOT find DIRECTFB (missing: DIRECTFB_LIB DIRECTFB_H_PATH)
-- Could NOT find OPENGLES (missing: OPENGLES_LIB OPENGLES_H_PATH)
-- Found EPOXY: /usr/local/lib64/libepoxy.so
-- Found EXPAT: /usr/lib64/libexpat.so
-- Could NOT find XERCESC (missing: XERCESC_LIB XERCESC_H_PATH)
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.4")
-- Found TINYXML: /usr/lib64/libtinyxml.so
-- Performing Test TINYXML_API_TEST
-- Performing Test TINYXML_API_TEST - Success
-- Could NOT find RAPIDXML (missing: RAPIDXML_H_PATH)
-- Could NOT find IL (missing: IL_LIB IL_H_PATH)
-- Could NOT find ILU (missing: ILU_LIB)
-- Found FREEIMAGE: /usr/lib64/libfreeimage.so
-- Found SILLY: /usr/lib64/libSILLY.so
-- Could NOT find CORONA (missing: CORONA_LIB CORONA_H_PATH)
-- Could NOT find PVRTOOLS (missing: PVRTOOLS_LIB PVRTOOLS_H_PATH)
-- Found LUA51: /usr/lib64/liblua.so
-- Found TOLUAPP: /usr/lib64/libtolua++.so
-- Found PythonInterp: /bin/python (found version "2.7.14")
-- Found PythonLibs: //lib64/libpython2.7.so (found suitable exact version "2.7.14")
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- python
-- unit_test_framework
-- system
-- timer
-- Found Doxygen: /bin/doxygen (found version "1.8.13") found components: doxygen missing components: dot
-- Found GTK2_GTK: /usr/lib64/libgtk-x11-2.0.so
-- Configuring done
-- Generating done
-- Build files have been written to:

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Failed to obtain desktop OpenGL version

Postby Ident » Sun Jan 07, 2018 20:45

Can you step towards the line where the RendererException is thrown and see if you find any more info about what fails? I wasn't involved in this epoxy addition, so it is hard for me to guess.

Also, could you tell us what instructions you followed?
CrazyEddie: "I don't like GUIs"

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Failed to obtain desktop OpenGL version

Postby YaronCT » Sun Jan 07, 2018 20:57

I no longer maintain my fork of epoxy. However, the good news is, the original project is now maintained (though with a new maintainer. I'll spare here my opinion about the new maintainer, but that's what we got now..). So, as a first step, I'd suggest you to use the official Epoxy (or, better, just start with the official development package of Epoxy of your distribution). Then please report how it goes.

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Sun Jan 07, 2018 21:25

Thank you both so much for taking the time to help me out.

For Ident, Here is the full debug using GDB:

Code: Select all

Reading symbols from ./MyProject...(no debugging symbols found)...done.
(gdb) start
Temporary breakpoint 1 at 0x4512eb
Starting program: /home/jay/projects/game3d/build/MyProject
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Temporary breakpoint 1, 0x00000000004512eb in main ()
(gdb) continue
Continuing.
CEGUI::RendererException in function 'void CEGUI::OpenGLInfo::initTypeAndVer()' (/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88) : Failed to obtain desktop OpenGL version.
terminate called after throwing an instance of 'CEGUI::RendererException'
  what():  CEGUI::RendererException in function 'void CEGUI::OpenGLInfo::initTypeAndVer()' (/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88) : Failed to obtain desktop OpenGL version.

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51   }


For YaronCT, I just downloaded the official Epoxy version that you linked. I am about to build and install it. Once it is installed, I will rebuild CEGUI. my project, and then update you when it is done.

Thank you again,
Jay

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Sun Jan 07, 2018 22:19

I finished downloading and installing the official version of Epoxy. I then rebuild CEGUI and my project. I continue to get the same errors.

I also tried the official development version for Fedora. It was the same.

Thank you again for taking the time to look into this with me,
Jay

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Failed to obtain desktop OpenGL version

Postby YaronCT » Mon Jan 08, 2018 09:30

Can u plz make sure that when u call bootstrapSystem then OpenGL is already initialized and working? Can you try, just before calling bootstrapSystem, test OpenGL e.g. by simply by clearing the whole viewport with some color?

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Tue Jan 09, 2018 00:01

Does this work? I adjusted my logic to call "CEGUI::OpenGL3Renderer& myRenderer = CEGUI::OpenGL3Renderer::bootstrapSystem();" on the 100th frame. So, my application launched. I moved around a little bit. I saw the scenery. Then, on the 100th frame it crashed with the same error.

Please let me know if this test was not sufficient.

Thank you,
-Jay

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Tue Jan 09, 2018 00:48

Just another data point, I just tried starting CEGUI the "hard way" with:

Code: Select all

cout << "Checkpoint 1" << endl;
CEGUI::OpenGL3Renderer& myRenderer = CEGUI::OpenGL3Renderer::create();
cout << "Checkpoint 2" << endl;
CEGUI::System::create( myRenderer );
cout << "Checkpoint 3" << endl;
 


The code crashed between checkpoints 1 and 2.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Failed to obtain desktop OpenGL version

Postby YaronCT » Fri Jan 12, 2018 09:49

The exception is thrown when "epoxy_gl_version" fails. That function should always return the OpenGL version (assuming OpenGL has been properly initialized. Epoxy itself doesn't have some initialization function). If it fails, and you've made sure at that stage OpenGL is properly working, that seems like a pure Epoxy issue. Your options, then, at this stage, are either to open an issue on the Epoxy github page, or try to debug it yourself. You shouldn't be that scared by the later, as Epoxy is a small and simple library. If you debug Epoxy and have some question feel free to ask and I'll try to help you, even though the new Epoxy maintainer has decided to remove every little thing I did there and do it all from scratch, so I might not be as familiar now with its code as I was when I was its maintainer.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Failed to obtain desktop OpenGL version

Postby YaronCT » Fri Jan 12, 2018 10:28

If you're going to open an issue on the Epoxy github page, just create a minimal program where OpenGL is already initialized, yet "epoxy_gl_version" fails (returns 0). It shouldn't contain anything else (including any cegui code). You should add the line:

#include <epoxy/gl.h>

instead (or at least before) including any OpenGL header directly. Same true for GLX, WGL and EGL, if you use them:

#include <epoxy/glx.h>
#include <epoxy/wgl.h>
#include <epoxy/egl.h>

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Fri Jan 12, 2018 21:00

#include <epoxy/gl.h> was already in the header file and it didn't cause any problems. It is only when I try to initialize CEGUI that I crash. The error given when I step through the debugger is:

CEGUI::RendererException in function 'void CEGUI::OpenGLInfo::initTypeAndVer()' (/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88) : Failed to obtain desktop OpenGL version.
terminate called after throwing an instance of 'CEGUI::RendererException'
what(): CEGUI::RendererException in function 'void CEGUI::OpenGLInfo::initTypeAndVer()' (/home/jay/tmp/cegui/cegui-0.8.7/cegui/src/RendererModules/OpenGL/GL.cpp:88) : Failed to obtain desktop OpenGL version.


I think that if I open a ticket with the epoxy github page, then they're going to tell me that the problem is with CEGUI seeing as including epoxy doesn't cause my error.

YaronCT
CEGUI Team
Posts: 448
Joined: Fri Jun 19, 2015 12:18
Location: Kiryat-Bialik, Israel

Re: Failed to obtain desktop OpenGL version

Postby YaronCT » Fri Jan 12, 2018 21:04

Sorry if I wasn't clear enough.

In order to reproduce the problem with Epoxy you must call epoxy_gl_version directly (which is where bootstrapSystem fails). Only including Epoxy headers isn't enough.

jay74
Just popping in
Just popping in
Posts: 19
Joined: Sun Jan 07, 2018 19:23

Re: Failed to obtain desktop OpenGL version

Postby jay74 » Sun Jan 14, 2018 19:29

Thank you for the clarification.

I put some debugging code in my application and the integer returned by epoxy_gl_version() is '0' ( zero ). The function returning zero doesn't appear to crash the application, but it does appear that CEGUI won't accept zero as a valid version number.

I'll write a short application and submit it as a bug unless the above info sheds some new light that I'm doing something wrong or there is a fix that doesn't require a bug report.

Thank you again,
Jay


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests