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

Nim enum issue #257

Closed
Riku5543 opened this issue Mar 23, 2020 · 8 comments
Closed

Nim enum issue #257

Riku5543 opened this issue Mar 23, 2020 · 8 comments

Comments

@Riku5543
Copy link

Riku5543 commented Mar 23, 2020

Hello! I just recently picked up Nim and wanted to use glad for opengl bindings. When I import the gl.nim file though, I get this error. (Generated OpenGL 3.3 Core with "Generate a loader" checked.)

gl.nim(107, 39) Error: -1 can't be converted to uint64

I peeked at the code, and it's in the section dealing with opengl enums.

@ghost
Copy link

ghost commented Mar 23, 2020 via email

@Dav1dde
Copy link
Owner

Dav1dde commented Mar 23, 2020

@johnnovak ping

@johnnovak
Copy link

Thanks @Dav1dde

@Develon5543 Can you please give me some details? Which Nim version are you using, is it the latest 1.0.6? Can you give me the exact parameters you used for generating the GL file?

@Riku5543
Copy link
Author

@johnnovak Yes, I'm currently using Nim 1.0.6. To generate the GL file, I went to the website and selected the language Nim. I kept the specification as OpenGL, set the gl api to 3.3, and picked the Core profile. I kept the other apis set to None, and didn't enable any extensions. The only option I checked was "Generate a loader". That gave me a zip file that only contains gl.nim which is what I was having issues with.

@johnnovak
Copy link

Thanks, I'll have a look today or tomorrow. I remember I had this issue before but I thought I fixed it. Anyway, I'll fix it better if it's still an issue :)

@johnnovak
Copy link

Ok, it turns out my memory is not so bad and I did fix this a while ago:

9c24809#diff-c52e84971d5983683d03074508272340R525-R528

The problem is that the webservice is running a version earlier than this commit. This has been confirmed by comparing the output of the webservice with the output of the current master version running locally.

Solution: @Dav1dde please update the webservice to use the latest master version.

In the meantime, you can clone the repo, check out the master branch and run the following command locally to get what you need:

python -m glad --extensions , --spec gl --api gl=3.3 --profile core --generator nim --out-path out

Alternatively, you can just change the following two const values manually to this:

  GL_TIMEOUT_IGNORED*: uint64 = 0xFFFFFFFFFFFFFFFF'u64
  GL_TIMEOUT_IGNORED_APPLE*: uint64 = 0xFFFFFFFFFFFFFFFF'u64

@Riku5543
Copy link
Author

Thank you so much, @johnnovak! I'll manually edit the files this time. Thank you for your help.

@Dav1dde
Copy link
Owner

Dav1dde commented Mar 25, 2020

I updated it just now:

image

Sorry about that, I must have previously updated glad2 instead of glad on accident.

Thanks for looking into it @johnnovak

@Dav1dde Dav1dde closed this as completed Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants