【发布时间】:2019-04-21 06:19:05
【问题描述】:
在我最新的 MacOS Mojave (10.14) 笔记本电脑上,使用 Python3.6 我正在尝试使用 OpenGL(使用 pyOpenGL),但在尝试使用某些功能时出现错误。例如
from OpenGL.GL import *
from OpenGL.GLU import *
from OpenGL.GLUT import *
glGenVertexArrays(1)
glGenVertexArrays 抛出以下异常:
OpenGL.error.NullFunctionError: Attempt to call an undefined function glGenVertexArrays, check for bool(glGenVertexArrays) before calling
在底层,在该函数内部,有一个名为“baseplatform.py:checkExtension()”的函数接收“false”以尝试检查 OpenGL 扩展:'GL_ARB_vertex_array_object'
此代码在 Windows 机器上完美运行。
存在一些 OpenGL 功能(之前调用了一些 OpenGL 函数并且不会引发错误)。 有人知道解决方法吗?也许要安装\升级\降级?
我知道 Apple 宣布他们将在未来放弃对 OpenGL 的支持,但据我所知,它应该不会影响 10.14。
【问题讨论】:
-
您是否尝试过其他版本不同的 macOS 机器?您确定 Apple 的 OpenGL 实现支持该功能吗?
标签: python macos opengl pyopengl macos-mojave