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

Generating EGL bindings fails #67

Closed
FlorianUekermann opened this issue Jan 30, 2016 · 7 comments
Closed

Generating EGL bindings fails #67

FlorianUekermann opened this issue Jan 30, 2016 · 7 comments

Comments

@FlorianUekermann
Copy link

This command:
./glow generate -api=egl -version=3.1
Fails with this message:
2016/01/30 17:49:24 unable to generate package: &{egl 2.0 my_home_folder/go/src/github.com/go-gl/glow/tmpl .* $^ false}

OS: Debian stretch

If I understood the README correctly, this should generate ES 3.1 bindings.

@dmitshur
Copy link
Member

dmitshur commented Feb 1, 2016

@errcw, do you know what's wrong here?

@FlorianUekermann
Copy link
Author

egl is the wrong flag for opengl es. Building egl with a matching version flag (not 3.1) works fine.
However, the flags gles1 and gles2 are missing in line 31 of README.md.

Please consider adding prebuilt packages for the different gles2 versions.

@errcw
Copy link
Member

errcw commented Feb 14, 2016

Yup, you're right, EGL is a different thing from OpenGL ES. The command glow generate -api=egl -version=1.5 should succeed... except it doesn't because Glow does not have full support for all the EGL types. Specifically when generating the constants it includes entries like DEFAULT_DISPLAY = ((EGLNativeDisplayType)0) which of course are not correctly compiled by Go. We'd need to introduce some special enum value parsing for generation to work correctly.

I'll leave this bug open (retitled) to reflect the issue.

@errcw errcw changed the title Generating OpenGL ES bindings fails Generating EGL bindings fails Feb 14, 2016
@errcw
Copy link
Member

errcw commented Feb 14, 2016

Actually this problem is already captured in #16, so I'll close this issue. I've updated the README to reflect that Glow will generate gles1 and gles2 APIs. I'd consider adding prebuilt packages but I'm on a Mac without access to khrplatform.h and therefore have no way to verify whether the output is correct so I'm really hesitant to commit blindly. If you'd like to contribute a known-working version that'd be great!

@errcw errcw closed this as completed Feb 14, 2016
@errcw
Copy link
Member

errcw commented Feb 14, 2016

Though interestingly working on this issue did uncover a problem generating gles1 bindings which I fixed in e976a4e. It may have affected some of the go-gl/gl generated bindings, too, but I doubt it and unfortunately I don't have the time to check right now.

@FlorianUekermann
Copy link
Author

Regarding contributing a known-working version: Since I filed the bug I have converted most of my OpenGL stuff to the gles2 api (so far without problems, v3.0 and v3.1, typical deferred renderer, so switching between framebuffers, multiple render targets etc, that should cover a pretty large fraction of the api). If that level of testing is sufficient I am happy to contribute those.
Do you just need me to confirm if the latest glow commit works every now and then, or would you prefer me to push the to a repository like "go-gl/gles2" myself.
Can't help with gles1 though, but I would guess the demand for that is fairly limited.

@errcw
Copy link
Member

errcw commented Feb 16, 2016

I'm really glad to hear the GLES API is working!

If you're interested in contributing I think the right path forward would be for you to propose a pull request to go-gl/gl that (1) updates generate.go to build gles2 v3.0 and v3.1 and (2) adds the resulting generated sources to the repository. That way it should be easy for the go-gl maintainers to keep everything up to date as these packages evolve.

This was referenced Feb 17, 2016
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

No branches or pull requests

3 participants