Comments (6)
I don't remember the reasoning behind it but it seems inconsistent with GLFW API.
Sometimes there are name collisions between funcs and structs and in those cases I might have done this to prevent the collision but this is not the case here.
My guess is that, fully spelled version is more Go-like and readable. If there is strong opinion to follow GFLW API strictly I'm not against it.
from glfw.
I see. Thanks for the prompt response!
If there is strong opinion to follow GFLW API strictly I'm not against it.
My main argument is that, unless there is a good reason, it is a needless place where someone who has used the C API (or any other language bindings, I guess) would possibly trip.
from glfw.
I think it's better just to keep the spelling the same as GLFW C library. Unless there are very pressing (more so than just better sounding name) reasons to do otherwise.
from glfw.
I will make a PR that changes the naming to be consistent with GLFW names. Let me know if there are any objections, but I think that's the best thing to do.
from glfw.
Just a thought,
someone who has used the C API (or any other language bindings, I guess) would possibly trip.
Isn't that unlikely since Go is statically typed, and there's godoc.org and likely autocompletion available? If someone tries to write window.SetCharCallback(...)
, they'll get an error:
./main.go:123: window.SetCharCallback undefined (type *glfw3.Window has no field or method SetCharCallback)
Then they'll go godoc.org and see that it's called something else. Or, more likely, they'll be looking at godoc.org to begin with (how else do they have a window
, etc.), or their autocompletion will suggest aracterCallback
when they type window.SetChar
:
Nevertheless, I still believe sticking with original upstream API func names where possible is simpler/better. Even if resolving this inconsistency is easy, it's better if it doesn't exist in the first place. Also, porting code will be easier as there'll be less manual/irregular changes.
Making a PR to close this issue now.
from glfw.
Closing this as the PR has been merged into the devel_glfw3.1
branch.
from glfw.
Related Issues (20)
- v3.3/glfw: warning: 'GLAPIENTRY' macro redefined HOT 2
- I can't run the case project properly HOT 2
- -
- No error handling in v3.3 HOT 5
- Old module name in README installation instructions HOT 3
- IME support HOT 6
- Build fail on macOS ventura 13.2.1 HOT 3
- How to use in windows? HOT 2
- v3.4 and supporting GLFW_MOUSE_PASSTHROUGH HOT 5
- Converting to execution character set: Illegal byte sequence
- can not build on macos 13.3.1 HOT 5
- Any way to try the glfw master branch to use libdecor ? HOT 1
- `(*glfw.Window).SetIcon` doesn't consider strides
- Unused import of image/draw after latest changes HOT 1
- Panic when creating cursor after latest changes HOT 1
- v3.3/glfw: GetKeyName incorrectly panics on unknown key and scancode HOT 6
- v3.3/glfw: CreateWindow can run into GLFW_NO_WINDOW_CONTEXT but doesn't accept it HOT 3
- v3.4/glfw: add support for GLFW version 3.4 (and future 3.4.x versions) HOT 7
- v3.3/glfw: Update to v3.3.10
- scripts: Grab upstream fails to apply patch for v3.2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glfw.