glCreateWindow throws null on M1

Hello,

I can’t really understand what is causing issue so asking your advise.

OS: Mac 12.2.1 Monterey
Processor: Apple Silicon M1
Device: Apple Mac Pro M1 Max
Visual Studio Code
GLFW: libglfw.3.3.dylib

Is there something I need to look into?

tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cppbuild",
			"label": "C/C++: clang++ build active file",
			"command": "/usr/bin/clang++",
			"args": [
				"-std=c++17",
				"-g",
				"-Wall",
				"-fdiagnostics-color=always",
				"-I${workspaceFolder}/include",
				"-L${workspaceFolder}/lib",
				"${workspaceFolder}/lib/libglfw.3.3.dylib",
				"${workspaceFolder}/lib/libassimp.5.2.0.dylib",
				"${workspaceFolder}/src/*.cpp",
				"${workspaceFolder}/src/*.c",
				"${workspaceFolder}/include/imgui/imgui.cpp",
				"${workspaceFolder}/include/imgui/imgui_demo.cpp",
				"${workspaceFolder}/include/imgui/imgui_draw.cpp",
				"${workspaceFolder}/include/imgui/imgui_widgets.cpp",
				"${workspaceFolder}/include/imgui/imgui_tables.cpp",
				"${workspaceFolder}/include/imgui/backends/imgui_impl_opengl3.cpp",
				"${workspaceFolder}/include/imgui/backends/imgui_impl_glfw.cpp",
				"-framework",
				"OpenGL",
				"-framework",
				"Cocoa",
				"-framework",
				"IOKit",
				"-framework",
				"CoreVideo",
				"-framework",
				"CoreFoundation",
				"-Wno-deprecated",
				"-o",
				"${workspaceFolder}/build/Point3D"
			],
			"options": {
				"cwd": "${workspaceFolder}/build"
			},
			"problemMatcher": [
				"$gcc"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"detail": "compiler: /usr/bin/clang++"
		}
	]
}

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/build/Point3D",
            "args": [],
            "cwd": "${workspaceFolder}",
            "stopAtEntry": true,
            "MIMode": "lldb",
            "preLaunchTask": "C/C++: clang++ build active file"
        }
    ]
}

Thanks in advance,

OMG, I found that M1 isn’t compatible with GLSL 460, so that’s the reason glCreateWindow returns NULL, but it works fine with 410.
Problem solved, thanks!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.