-
Notifications
You must be signed in to change notification settings - Fork 182
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 FreeBSD support to the glfw joystick code. #318
base: master
Are you sure you want to change the base?
Conversation
Tested with the multimedia/webcamd port as "driver", and an Xbox One game pad. Assumes "Linux" for game pad definitions, which seems right as webcamd actually is wrapping the Linux drivers. Note that part of this may have to be synced upstream with glfw. No idea how this process works in go-gl/glfw.
One issue seems to be that it's unlikely this can be upstreamed to glfw - current glfw organizes joystick support differently enough for the same patch not working on both. |
Hi, Thanks for this however most of this patch needs to be sent to upstream. Also the null joystick was accepted via #285 so it might be a good idea to see why it was done that way in the first place. I'm no expert neither in joystick API nor in BSD so I don't want to misdirect. |
I think it was done that way in the first place as it may have been easier. Anyway, filed glfw/glfw#1892 for now, which would then reduce this PR to just the changes to c_glfw_freebsd.go plus a new revision hash for upstream code. However it kinda depends on whether glfw will accept changes on top of stable or if this will require a glfw 3.4 release and then go-gl/glfw upgrading to that with potential API changes. I'd really like to have my gamepad supported "soon". Can we keep this PR open until we resolved how this should be upstreamed and ported back here? |
The way we do it at the moment is to avoid introducing any downstream delta to the C files of glfw itself. That's why travis is failing - it gets the sources from the official repository and diffs them to make sure they're the same. The rationale is that we don't want to be maintaining a glfw fork. To update glfw, modify https://github.com/go-gl/glfw/blob/master/v3.3/glfw/GLFW_C_REVISION.txt and run scripts/grab-upstream.sh. I think I'd prefer to see a tracking issue in go-gl/glfw rather than this pull request. I think your next step is to get this fixed in upstream glfw, and once it's in a glfw release, we can pull it in to go-gl/glfw. |
Was this added upstream into glfw? If so, maybe this PR should be closed by now? |
Doesn't look like it has landed upstream yet. Here are some references: Happy to leave this PR open for anyone who wants to watch for it getting closed, until that is resolved. |
Tested with the multimedia/webcamd port as "driver", and an
Xbox One game pad. Assumes "Linux" for game pad definitions,
which seems right as webcamd actually is wrapping the Linux
drivers.
Note that part of this may have to be synced upstream with glfw.
No idea how this process works in go-gl/glfw.
Explanation of the parts:
linux_joystick
to also work on FreeBSD:+
does not exist there.PATH_MAX
comes from<limits.h>
.