SFML community forums

Help => Window => Topic started by: OniLinkPlus on October 21, 2012, 10:36:09 pm

Title: Error in the OpenGL Version Picking
Post by: OniLinkPlus on October 21, 2012, 10:36:09 pm
A while back, it was suggested that if an SFML window fails to create an OpenGL context of a specific, requested version (say, 4.3), it falls back to a previous version, and continues to do so until it finds a supported version. Right now, I have a bit of code that creates a window with an OpenGL version of 4.3 (but my graphics cards only supports up to 4.2), and instead of falling back to a previous version of OpenGL, it instead crashes with the following error:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  34 ()
  Serial number of failed request:  89
  Current serial number in output stream:  90

I am using the latest version of SFML2 from the repository. I did search for this error, but found nothing.

A complete and minimal source that demonstrates this is here (http://pastebin.com/XbEyvDhJ).

I'm running an NVidia GTX 460 on Arch Linux. Drivers are proprietary, 304.51. I just updated to 304.60 though, so I will test with those as well and edit with the results.
Title: Re: Error in the OpenGL Version Picking
Post by: Laurent on October 21, 2012, 10:52:55 pm
What happens after this error message is printed? Does the program crash? Or does it continue to run? If so, what does window.getSettings() say about the context version? And if it crashes, what does the debugger say?
Title: Re: Error in the OpenGL Version Picking
Post by: OniLinkPlus on October 22, 2012, 03:19:34 am
What happens after this error message is printed? Does the program crash? Or does it continue to run? If so, what does window.getSettings() say about the context version? And if it crashes, what does the debugger say?
It completely crashes out. GDB gives no additional information. SFML prints nothing. All I get is the X error that I posted already. The driver update didn't help, either.
Title: Re: Error in the OpenGL Version Picking
Post by: mateandmetal on October 24, 2012, 12:11:39 am
Maybe using an old GLEW version

GLEW 1.9.0 Available OpenGL 4.3 Support (http://www.geeks3d.com/20120808/glew-1-9-0-available-opengl-4-3-support/)

Try updating the GLEW library
Title: Re: Error in the OpenGL Version Picking
Post by: OniLinkPlus on October 24, 2012, 06:46:21 am
Maybe using an old GLEW version

GLEW 1.9.0 Available OpenGL 4.3 Support (http://www.geeks3d.com/20120808/glew-1-9-0-available-opengl-4-3-support/)

Try updating the GLEW library
Oddly, GLEW has not been updated from 1.8 in Arch's repositories, and there seems to be no plans of doing so. How frustrating.
Title: Re: Error in the OpenGL Version Picking
Post by: OniLinkPlus on October 24, 2012, 06:49:46 am
Maybe using an old GLEW version

GLEW 1.9.0 Available OpenGL 4.3 Support (http://www.geeks3d.com/20120808/glew-1-9-0-available-opengl-4-3-support/)

Try updating the GLEW library
Updating GLEW did not help.
Title: Re: Error in the OpenGL Version Picking
Post by: OniLinkPlus on October 27, 2012, 05:35:22 am
I've been looking into a possible solution to this problem, and I found a function in GLEW that may be of interest. The example code given is

if (glewIsSupported("GL_VERSION_1_4"))
{
  /* Great, we have OpenGL 1.4. */
}

Perhaps dynamically build a string from the context settings, automatically inserting the version number, and using this function to test the version before trying to build the context? Because as it is right now, on Linux, the program completely crashes out to desktop if we even attempt to make a context with an unsupported version.
Title: Re: Error in the OpenGL Version Picking
Post by: Laurent on October 27, 2012, 06:57:38 pm
Quote
Because as it is right now, on Linux, the program completely crashes out to desktop if we even attempt to make a context with an unsupported version.
So they should fix their drivers. I'm not going to write a workaround in SFML because of buggy drivers ;)