-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add EGL support (And config struct) #30
Conversation
I am genuinely not sure about the extra function parameter, it looks like it could break a lot of existing things, and I feel like this will need something like a struct for general configuration later on as Wayland support is being implemented... |
Breaking compatibility should be ok, projects using the bindings would either copy them into their project, or integrate it as a git submodule. In both cases the build would only break after deliberately updating the bindings. But a few smaller changes would be nice similar to the Wayland PR:
|
I was also thinking about something, is it really necessary to still support GLX? as far as I know, EGL is supported on pretty much anywhere and gives more freedom to what kind of OpenGL context is obtained. Anyways, I will do a little sketch and upload it in a second :) |
I just added a new My idea was to make everything also have a default value, so for example, the
|
I think it could be useful if you could left off certain sokol libraries, for example, skip |
I've just added Wayland build support, based upon what I saw implemented on #30, It works with and without the Wayland Again, I insist on considering to drop GLX support altogether and just use EGL, it would greatly simplify things as I can see a great part of the X11 implementation being based upon GLX which does not bring any sort of realistic gain over just using EGL, to my knowledge. (It could also be backwards, as in, to main EGL by default, then allow for GLX behind a flag.) I've also noticed that making certain parts of sokol optional would be pretty easy to implement, i dont think all of them need to be optional since some of them don't even leave any trace in the output binary if they're not used in the code itself, but some of them create linker dependencies; |
Note that for Wayland support you would need to generate your own bindings using the so far 'inofficial' Wayland PR. Not sure how much sense it makes to put that into the vanilla build.zig file, might just be confusing to users when they try it out and it doesn't work. |
And merged, thanks! I'll probably add a comment about the X11 vs Wayland flags so that users are not confused. |
Now that EGL support has been added to
sokol_app.h
, it would make sense that the zig counterpart would also support it as a flag or something related.I wrote a small patch which would allow for the zig build process to link towards EGL and use the right flags.
Maybe this code is a bit dirty, but that's what pull requests are for :)