Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Error in the OpenGL Version Picking  (Read 7400 times)

0 Members and 1 Guest are viewing this topic.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Error in the OpenGL Version Picking
« 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.

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.
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Error in the OpenGL Version Picking
« Reply #1 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?
Laurent Gomila - SFML developer

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Error in the OpenGL Version Picking
« Reply #2 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.
« Last Edit: October 22, 2012, 03:23:29 am by OniLinkPlus »
I use the latest build of SFML2

mateandmetal

  • Full Member
  • ***
  • Posts: 171
  • The bird is the word
    • View Profile
    • my blog
Re: Error in the OpenGL Version Picking
« Reply #3 on: October 24, 2012, 12:11:39 am »
Maybe using an old GLEW version

GLEW 1.9.0 Available OpenGL 4.3 Support

Try updating the GLEW library
- Mate (beverage) addict
- Heavy metal addict _lml
- SFML 2 addict
- My first (and free) game: BichingISH!

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Error in the OpenGL Version Picking
« Reply #4 on: October 24, 2012, 06:46:21 am »
Maybe using an old GLEW version

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.
I use the latest build of SFML2

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Error in the OpenGL Version Picking
« Reply #5 on: October 24, 2012, 06:49:46 am »
Maybe using an old GLEW version

GLEW 1.9.0 Available OpenGL 4.3 Support

Try updating the GLEW library
Updating GLEW did not help.
I use the latest build of SFML2

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Error in the OpenGL Version Picking
« Reply #6 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.
I use the latest build of SFML2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Error in the OpenGL Version Picking
« Reply #7 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 ;)
Laurent Gomila - SFML developer