Unrecognized OpenGL version

Started by
12 comments, last by stella1016 14 years, 1 month ago
I am using qt (+opengl) to implement a program. I need to test it on different OS. It has problem in Fedora 12 and Ubuntu 9.10. The terminal shows "Unrecognized OpenGL version", and the display is frozen. I checked the opengl version on different OS. The OSs which are working have lower opengl version. for example: OpenSUSE 10.3 32bit: server glx version string: 1.2 client glx version string: 1.4 OpenGL version string: 1.4 (2.1 Mesa 7.0.1) The OS which doesn't work: Ubuntu 9.10 32bit: server glx version string: 1.2 client glx version string: 1.4 OpenGL version string: 2.1 ( Mesa 7.6) OpenGL shading language version string: 1.20 Fedora 12 32bit: server glx version string: 1.2 client glx version string: 1.4 OpenGL version string: 2.1 Mesa 7.7-devel OpenGL shading language version string: 1.20 I am thinking about the problem might be: higher opengl version doesn't support my program. Am I right? Does anyone know the solution? Thanks in advance.
Advertisement
I found some hint in OpenGL website:
--------------
23.040 How can I code for different versions of OpenGL?

Because a feature or extension is available on the OpenGL development environment you use for building your app, it doesn't mean it will be available for use on your end user's system. Your code must avoid making feature or extension calls when those features and extensions aren't available.

When your program initializes, it must query the OpenGL library for information on the OpenGL version and available extensions, and surround version- and extension-specific code with the appropriate conditionals based on the results of that query. For example:

#include <stdlib.h> ... int gl12Supported; gl12Supported = atof(glGetString(GL_VERSION)) >= 1.2; ... if (gl12Supported) { // Use OpenGL 1.2 functionality }
--------------

What is the difference between Opengl version 1.4 and 2.1??

The main difference between them is that OpenGL 2.1 has buffer objects and shaders and is much more up-to-date. It is what most of the hardware in the wild supports, too.

It is fully backwards compatible with version 1.4 unlike the more recent versions, such as 3.3 and 4.0. Those more recent versions add features that are only found in the more recent GPUs and drop functionality which is not supported in hardware any more.
The 3.0 and 3.1 versions are "in between" as they still do support old features, but consider them deprecated.
But still, I have problem with my application.

I compiled my application in OpenSUSE 10.3, and executed it in Ubuntu 9.10. The problem comes only in Ubuntu 9.10, and the difference I could find is opengl version. If opengl 2.1 is backwards compatible, I don't know why the problem comes....
That message means Qt couldn't parse the version string from OpenGL (glGetString(GL_VERSION)), probably because it's malformed, and that would be a driver bug.

You can check how that message is triggered here
Are the appropriate drivers installed? What is the vendor string? Mesa appearing in the output you have posted makes me believe you are using the software rasterizer. I use Qt for my OpenGL applications on Ubuntu 9.4 and 9.10 and I had no problems with the NVidia drivers installed.

Qt seems to expects the version string to look like for example "1.4" but not like "1.4 (2.1 Mesa 7.0.1)". NVidia and ATI drivers actually return in the expected format.
OK, sth I missed to mention.
I am running my OS in VM.

But I tested 'real' OS of Ubuntu 9.10 as well. There I got more strange result: one account is with OpenGL version 1.4 (my app works), another account with 2.1 (my app not working). The hardware is the same. How could this happen? Install additional libs?
With the NVidia drivers installed, my collegue's machine also works.

So the driver is a must for my app? What if on VM?
Quote:Original post by stella1016
With the NVidia drivers installed, my collegue's machine also works.

So the driver is a must for my app? What if on VM?


VMs have limited support for hardware accelerated graphics, VirtualBox for example has some DX/GL drivers for Windows (as guest OS).
OpenGL is an API to make use of the GPU, when no hardware acceleration is available why would you want to use OpenGL? Well, if needed there is Mesa, a software implementation (much slower than hardware). You could try making Qt parse the GL version that is returned by Mesa.
But why this differs for different version of Ubuntu (all based on VM)? Other OS doesn't have the real hardware to support, but they worked, and this Ubuntu 9.10 doesn't.

I am thinking about some init error of my app....

This topic is closed to new replies.

Advertisement