Skip to content
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

[LWJGL] GLFW_VERSION_UNAVAILABLE error on MacBook Pro 2015 #2

Open
johnboy14 opened this issue Mar 10, 2018 · 2 comments
Open

[LWJGL] GLFW_VERSION_UNAVAILABLE error on MacBook Pro 2015 #2

johnboy14 opened this issue Mar 10, 2018 · 2 comments

Comments

@johnboy14
Copy link

johnboy14 commented Mar 10, 2018

I receive the following error when running the Main class on my Macbook Pro. My Macbook pro currently supports OpenGL 4.1. So I'm utterly confused about this error.

[LWJGL] GLFW_VERSION_UNAVAILABLE error
	Description : NSGL: The targeted version of macOS only supports forward-compatible core profile contexts for OpenGL 3.2 and above
	Stacktrace  :
		org.lwjgl.glfw.GLFW.nglfwCreateWindow(GLFW.java:1649)
		org.lwjgl.glfw.GLFW.glfwCreateWindow(GLFW.java:1827)
		core.kernel.Window.create(Window.java:61)
		core.kernel.CoreEngine.createWindow(CoreEngine.java:41)
		core.Main.main(Main.java:9)

https://support.apple.com/en-us/HT202823

MacBook Pro (Retina, 15-inch, Mid 2015) AMD Radeon R9 M370X 4.1 1.2

@adamarbour
Copy link

adamarbour commented Mar 30, 2018

I had/have the same issue. In order to use 4.1 on your mac, you'll need to provide some additional hints. You can see that the default profile for most macs is 2.1 (https://support.apple.com/en-us/HT202823) however the core profile is 4.1 for newer macs.

In order to use this, you'll need to add the following hints:

glfw.window_hint(glfw.CONTEXT_VERSION_MAJOR, 4)
glfw.window_hint(glfw.CONTEXT_VERSION_MINOR, 1)
glfw.window_hint(glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE) <--- This telling the mac to use the core profile
glfw.window_hint(glfw.OPENGL_FORWARD_COMPAT, True) <--- This telling the mac to deprecate everything before it basically

With these hints, I have no issue using the 4.1 version. Hopefully, you've figured this out by now but if not, the information is here for reference.

@baughmann
Copy link

For future reference, this is still happening. The changes to Window.java that I had to make on my 2019 iMac Pro are as follows:

Inside create()

glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);	
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);	
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants