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

Open
wants to merge 18 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@tapir
Member

tapir commented Aug 4, 2018

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?

@kivutar

This comment has been minimized.

kivutar commented Oct 7, 2018

@tapir On OSX 10.14 with

	glfw.WindowHint(glfw.ContextVersionMajor, 3)
	glfw.WindowHint(glfw.ContextVersionMinor, 2)
	glfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)
	glfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True)
	glfw.WindowHint(glfw.TransparentFramebuffer, glfw.True)

I'm getting:

# 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]

Has MoltenVK become a mandatory dependency?

What about the other errors in native_darwin.c?

@Noofbiz

This comment has been minimized.

Noofbiz commented Oct 7, 2018

Yes, Mojave (10.14) has depreciated opengl in favor of molten.

@kivutar

This comment has been minimized.

kivutar commented Oct 31, 2018

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.

@tapir

This comment has been minimized.

Member

tapir commented Oct 31, 2018

I have no knowledge at all about OSX. I hate it with passion. So somebody else needs to take the wheel there. @dmitshur maybe?

@dmitshur

This comment has been minimized.

Member

dmitshur commented Oct 31, 2018

GLFW could also be used with Metal

Indeed it can. I'm currently using GLFW v3.2 on macOS with Metal here.

So somebody else needs to take the wheel there. @dmitshur maybe?

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.

v3.2/glfw does not require MoltenVK framework as far as I know, so v3.3/glfw shouldn't either. @kivutar, does v3.2/glfw work okay for you?

@kivutar

This comment has been minimized.

kivutar commented Nov 1, 2018

Yes v3.2/glfw works well with OpenGL on OSX. Especially on High Sierra. On Mojave there are a few bugs, a vsync bug, and a context update bug, declared in the GLFW tracker. These two bugs have workarounds. I'm using it here.

@mokiat

This comment has been minimized.

mokiat commented Nov 15, 2018

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 MoltenVK.framework folder in /Library/Frameworks. I also tried to set a bunch of environment variables like PATH and DYLD_LIBRARY_PATH to what I believe is correct. Unfortunately, I keep getting the same error. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment