Skip to content
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

Fix GLAD error condition #2059

Merged
merged 1 commit into from
Sep 3, 2018
Merged

Fix GLAD error condition #2059

merged 1 commit into from
Sep 3, 2018

Conversation

jiri
Copy link
Contributor

@jiri jiri commented Sep 3, 2018

gladLoadGL returns 0 on fail, not the other way around.

Excerpt from glad.c generated by the oficial site:

glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
if(glGetString == NULL) return 0;
if(glGetString(GL_VERSION) == NULL) return 0;
	
// ...

if (!find_extensionsGL()) return 0;
return GLVersion.major != 0 || GLVersion.minor != 0;

`gladLoadGL` returns 0 on fail, not the other way around.

Excerpts from `glad.c` generated by [the oficial site](https://glad.dav1d.de):

```c++
glGetString = (PFNGLGETSTRINGPROC)load("glGetString");
if(glGetString == NULL) return 0;
if(glGetString(GL_VERSION) == NULL) return 0;
	
// ...

if (!find_extensionsGL()) return 0;
return GLVersion.major != 0 || GLVersion.minor != 0;
```
@ocornut ocornut merged commit f8b7e4d into ocornut:master Sep 3, 2018
@ocornut
Copy link
Owner

ocornut commented Sep 3, 2018

Thank you, merged!

ocornut added a commit that referenced this pull request Sep 4, 2018
@jiri jiri deleted the patch-1 branch September 4, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants