【问题标题】:PyOpenGL: glCreateProgram() causes NullFunctionErrorPyOpenGL:glCreateProgram() 导致 NullFunctionError
【发布时间】:2018-07-30 16:59:03
【问题描述】:

我只是想准确地运行这个示例代码来测试安装: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 以及我的脚本运行所在的文件夹中。

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

我通过远程桌面运行带有 64 位 Python 3.5 的 Windows 10 64 位

【问题讨论】:

  • 对于glCreateProgram,至少需要 OpenGL 2.0 或 OpenGL ES 2.0。使用print( glGetString(GL_VERSION) )(在initialize()之前)打印OpenGL版本。
  • Windows 远程桌面使用软件 OpenGL 1.1,不支持着色器。试试workaroundRemoteFx
  • 谢谢,问题解决了:)
  • 对于其他检查是否在创建渲染上下文后调用 glCreate 函数(也不是通过 glut 或任何其他方式)

标签: python shader pyopengl


【解决方案1】:

问题是,当您在远程桌面上登录时,您不知何故无法访问显卡。将屏幕直接连接到电脑解决了这个问题。

【讨论】:

    猜你喜欢
    • 2014-12-29
    • 1970-01-01
    • 1970-01-01
    • 2018-10-09
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-31
    相关资源
    最近更新 更多