-
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
3.3 beta - don't merge yet #219
Conversation
@tapir On OSX 10.14 with
I'm getting:
Has MoltenVK become a mandatory dependency? What about the other errors in native_darwin.c? |
Yes, Mojave (10.14) has depreciated opengl in favor of molten. |
I understand that GL is deprecated. But Elmindreda told me on IRC that GLFW could also be used with Metal and that GL will continue to work on OSX even if they are not going to add newer versions and that a few things will break. go-gl/glfw/v3.2 is go getable without the need to install any additional library on the system. Molten is not yet something that one can easily install on OSX, there are no brew packages. |
I have no knowledge at all about OSX. I hate it with passion. So somebody else needs to take the wheel there. @dmitshur maybe? |
Indeed it can. I'm currently using GLFW v3.2 on macOS with Metal here.
Sure, I'll help with the macOS side of things. I don't know when I'll have free time, but I'll try to get to it.
|
Yes |
Has anyone managed to get this pull request running on MacOS? Now that with Mojave GLFW 3.2 is no longer running, I decided to give the GLFW 3.3 (be it unstable) a try. I am hitting the same problem as @kivutar : # github.com/go-gl/glfw/v3.3/glfw
ld: framework not found MoltenVK
clang: error: linker command failed with exit code 1 (use -v to see invocation)
# github.com/go-gl/glfw/v3.3/glfw
native_darwin.c:7:17: warning: implicit declaration of function 'glfwGetCocoaWindow' is invalid in C99 [-Wimplicit-function-declaration]
native_darwin.c:7:9: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
native_darwin.c:11:17: warning: implicit declaration of function 'glfwGetNSGLContext' is invalid in C99 [-Wimplicit-function-declaration]
native_darwin.c:11:9: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] I downloaded Vulkan SDK and put the |
I actually have a gist here https://gist.github.com/Noofbiz/de83517b848f153750a43346dbdcd3e9 that uses sdl to call vulkan and draw a triangle. I'll try switching to glfw 3.3 tomorrow to see if it works. Since I can confirm that vulkan is working on Mojave it'll let us know if glfw is the issue |
Alright, so adding
|
@tapir are you planning on exposing more of the functions required for Vulkan? In your comment you said that "As a side note, I see no reason to implement the Vulkan functions. Thanks to Window.Handle() vulkan-go packages can access the GLFW window handle and create the necessary surface" but this doesn't make sense to me. Vulkan requires access to quite a few functions of GLFW for detecting required extensions, loading the vulkan function pointers, and many more features. Will this be addressed in this branch? I know there's a divergent fork of the code base maintained by |
Reminder to implement #234 |
I'm open to discussion too, but so far, this doesn't look like an improvement to me. You said:
Can you elaborate in what way it was not idiomatic? A Go function that can fail returning a Let's look at the diff of the example in README: @@ -20,7 +20,7 @@ package main
import (
"runtime"
- "github.com/go-gl/glfw/v3.2/glfw"
+ "github.com/go-gl/glfw/v3.3/glfw"
)
func init() {
@@ -30,15 +30,14 @@ func init() {
}
func main() {
- err := glfw.Init()
- if err != nil {
- panic(err)
+ if !glfw.Init() {
+ panic(glfw.GetError())
}
defer glfw.Terminate()
- window, err := glfw.CreateWindow(640, 480, "Testing", nil, nil)
- if err != nil {
- panic(err)
+ window := glfw.CreateWindow(640, 480, "Testing", nil, nil)
+ if window == nil {
+ panic(glfw.GetError())
} This looks like the Go API is becoming worse. In addition to that, it's a breaking API change. I don't use the C GLFW API very often and I'm very used to the Go |
Just my 2 cents, but I have to agree with @dmitshur. Errors in Go should be self-documenting. An Besides, these changes would make the API unable to make use of the current Go 2 error handling draft. |
It's been a while since this PR was made, now I think it's not necessary to break the API in such a huge way eventhough we're allowed to do breaking changes with new versions. So I'm OK with putting that away. I'm not going to be around for couple weeks so maybe someone can take this PR over? Things left to do are
|
Could we also check that it can still build without MoltenVK on OSX? For people who are still using GL. |
FWIW, I agree with @dmitshur and @AntyMew. |
Can I help by PR'ing #234 onto the 3.3-beta branch? |
I was able to compile and use this branch on OSX without Vulkan by doing the following modifications: In So there must be a way to detect if MoltenVK is there and apply these changes at preprocessor time. Maybe using |
Hello I was wondering if there has been any updates on ether removing Vulkan and MultenVk from v3.3 or fixing the current errors on mac as it is still breaking for me even after trying some of the fixes here. I am wanting to try and use this version to try and make a Rainmeter like program that is cross platform but this current breaking issue is making it not possible on mac. |
No way, there is the only point of waiting for official 3.3 release from GLFW and go-gl. |
@xlab Vulkan is not the only point. There are also important bug fixes, and other features like the joypad database. |
My understanding is that this PR needs someone to take over the work. Is that right @tapir? Any volunteers? |
It turns out that glfw 3.2 does not support a window in a headless environment. Apparently glfw3.3 does have support, but go-glfw does not support 3.3 yet. (go-gl/glfw#219)
Please consider #256 |
GLFW tag 3.3-stable @ glfw/glfw@e4e9581 * Fix C Include & address GLFW v3.3 removals * Glfw moved away from posix_tls.c to posix_thread.c (this reflects that they now contain more than TLS) * Glfw moved away from win32_tls.c to win32_thread.c (same as above) * Glfw removed wayland-.*-unstable-v1-client-protocol.c * Glfw added wl_platform.h * Glfw removed GLFW_USE_RETINA, _GLFW_USE_CHDIR and _GLFW_USE_MENUBAR compile-time macros * Glfw removed support for MIR * Address deprecations of glfw 3.3 * Glfw deprecate glfwSetCharModsCallback * Glfw deprecate the window parameter of glfwGetClipboardString and glfwSetClipboardString, NULL can be used as the window argument * Add glfw.SetClipboardString(string) and glfw.GetClipboardString() function (no Window type required) * Use casting and clang-format c code * Use casting instead of callback in C helpers (same as #219) * Update travis * Fix Darwin build tag Fixes: #245, #255, #240, #230, #170
Got rid of internal error callback. Never liked the way we solved it back then. It was not idiomatic and it was not mirroring the C API (worst of both worlds?). Now we have glfwGetError() function along with callback setting ability. It's still not idiomatic (only way to do it idiomatically is to return errors from all functions) but at least it mirrors the C API now. As always I'm open to suggestions. Any opinions?
I've also noticed that the 2 joystick functions we have were accepting the joystick IDs as arguments whereas we could have made it receivers. As our aim is to make the library as idiomatic as possible I've changed it. With 3.3 we have many more joystick functions so I think it looks better now. What do you think?
As a side note, I see no reason to implement the Vulkan functions. Thanks to Window.Handle() vulkan-go packages can access the GLFW window handle and create the necessary surface. So as is, it's ready for Vulkan.
README.md has the changelog as always, if you want to see the details.
Looks complete now according to this: http://www.glfw.org/docs/3.3/news.html
Did I miss anything?