I tried installing PDL::Graphics::TriD and failed to see demo. Claude.ai helped me to workaround as follows, I hope helps communitiy:
Environment
- macOS Sequoia (Intel Mac mini)
- Perl 5.42.1 (Homebrew)
- PDL::Graphics::TriD 2.102
- OpenGL::Modern 0.0404
- freeglut 3.8.0 (Homebrew)
Problem
Running demo 3d in pdl2 crashes with:
Error: Missing GL version at .../PDL/Graphics/TriD/GL.pm line 499
The error string "Missing GL version" originates from
OpenGL::Modern's GLEW initialization code (glew.c).
Root Cause
In lib/PDL/Graphics/TriD/GL/GLFW.pm, after glfwCreateWindow() is
called, there is no call to glfwMakeContextCurrent() before GLEW
attempts to retrieve the GL version. GLEW requires an active OpenGL
context to initialize correctly. On macOS, unlike some Linux
configurations, OpenGL contexts are never implicitly made current, so
glewInit() fails immediately.
The fix should be to add:
glfwMakeContextCurrent($glfwin);
immediately after the glfwCreateWindow() call (around line 21 of
GLFW.pm).
Workaround
Setting the environment variable before launching pdl2 works around
the issue by switching to the GLUT backend:
export POGL_WINDOW_TYPE=glut
Notes
The GLUT backend works correctly on this system.
I tried installing PDL::Graphics::TriD and failed to see demo. Claude.ai helped me to workaround as follows, I hope helps communitiy:
Environment
Problem
Running
demo 3din pdl2 crashes with:The error string "Missing GL version" originates from
OpenGL::Modern's GLEW initialization code (glew.c).Root Cause
In
lib/PDL/Graphics/TriD/GL/GLFW.pm, afterglfwCreateWindow()iscalled, there is no call to
glfwMakeContextCurrent()before GLEWattempts to retrieve the GL version. GLEW requires an active OpenGL
context to initialize correctly. On macOS, unlike some Linux
configurations, OpenGL contexts are never implicitly made current, so
glewInit()fails immediately.The fix should be to add:
immediately after the
glfwCreateWindow()call (around line 21 ofGLFW.pm).
Workaround
Setting the environment variable before launching pdl2 works around
the issue by switching to the GLUT backend:
Notes
The GLUT backend works correctly on this system.