python - PyOpenGL:glCreateProgram() 导致 NullFunctionError

标签 python shader pyopengl

我只是想运行这个示例代码来测试安装:https://gist.github.com/ousttrue/c4ae334fc1505cdf4cd7

尽管我已经使用此处的 whl 文件安装了 PyOpenGL、PyOpenGL-accelerate 和 freeglut,但 glCreateProgram() 仍失败:https://www.lfd.uci.edu/~gohlke/pythonlibs/

错误:

  File "C:\Program Files (x86)\Python\Python35\lib\site- 
  packages\OpenGL\platform\baseplatform.py", line 410, in __call__ 
  self.__name__, self.__name__, 
  OpenGL.error.NullFunctionError: Attempt to call an undefined function 
  glCreateProgram, check for bool(glCreateProgram) before calling

本教程中不包含着色器的代码工作得很好:https://noobtuts.com/python/opengl-introduction 所以只是 glCreateProgram() 失败了。

我还将 DLL 文件复制到 SystenWOW64 和 System32 以及我的脚本运行所在的文件夹中。

有谁知道在哪里搜索错误。

我通过远程桌面运行 Windows 10 64 位和 64 位 Python 3.5

最佳答案

问题是,当您登录远程桌面时,您无法访问显卡。将屏幕直接连接到计算机解决了问题。

关于python - PyOpenGL:glCreateProgram() 导致 NullFunctionError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51480426/

相关文章:

unity-game-engine - 着色器使立方体的边缘倾斜?

python - PyOpenGL OBJ Loader 未正确加载

python - 为什么 OpenGL Superbible 第 6、7 版的 spincube 示例的 python 代码中没有出现立方体

python - 使用opengl进行平铺渲染

python - 避免 PowerShell 中的 Schtask 重复

python - 在 Azure Databricks 中按范围内的值进行分组

glsl - 为什么 GLSL 中的 texture1d() 返回 vec4?

unity3d - 如何在 Unity 中设置整个颜色 channel 的饱和度

python - 在 center_longitude 上的 cartopy 等高线图中的白线

python - 如何在 Python 中用阿拉伯语对计数器进行排序