-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Applied patch to not crash on 3.2+ core profiles #17
base: master
Are you sure you want to change the base?
Conversation
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=727175 Most SOIL functions crash if OpenGL context is 3.2+ core profile. SOIL calls glGetString with a value that is no longer valid, and then sends the returned null pointer to strstr. This patch checks the OpenGL version at runtime, and uses a glGetString function that is appropriate and available. It doesn't crash if, for whatever reason, glGetString returns a null pointer.
Hey thanks! I'm curious, but why are the files are severely different? It seems like you've changed a heck of a lot more then just glGetString |
Uhm, that's a good question. All I added were the changes from the patch you can find in the bugreport I've linked above, along with a comment that it was patched and where I did get the patch from. |
Yep, line-endings. I've changed them back to windows-style. By doing that I've accidentially commited a codeblocks file, which I've then deleted. Here's a patch with the changes only, in case you cannot use the pull request: |
Thinking about the changes, it likely won't work on windows and maybe mac due to the usage of glXGetProcAddressARB. Maybe the SOIL_internal_has_OGL_capability function could be improved by using parts of njcrawford's code. Can't test that for windows and mac unfortunately. |
I can test it on mac and windows if it's in a state you think it'd work, but unfortunately I'm not familiar with OpenGL 3.2+ |
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=727175
Most SOIL functions crash if OpenGL context is 3.2+ core profile. SOIL calls
glGetString with a value that is no longer valid, and then sends the returned
null pointer to strstr.
This patch checks the OpenGL version at runtime, and uses a glGetString function
that is appropriate and available. It doesn't crash if, for whatever reason,
glGetString returns a null pointer.