python - glGenTextures 中的 pyopengl 错误

标签 python opengl segmentation-fault

我有这个问题:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from OpenGL.GL import *
>>> glGenTextures
<OpenGL.lazywrapper.glGenTextures object at 0x9d3b18c>
>>> glGenTextures(1)
Segmentation fault

我使用的是 Ubuntu 10.04 LTS

它可能是什么?我在哪里可以找到其他信息?

最佳答案

在调用任何 OpenGL 函数之前,您应该激活上下文。另外,glGenTextures 需要两个参数,因此 pyopengl 不会直接调用它。您必须查看 pyopengl 源代码才能准确了解出了什么问题,但首先创建上下文肯定是解决方案的一部分。

关于python - glGenTextures 中的 pyopengl 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5445304/

相关文章:

opengl - 在OpenGL中绘制 "point-like"形状,无视缩放

c++ - 像这样调整 vector 大小时如何避免段错误

静态函数变量的 Pythonic 方式(小范围,单一初始化)?

python - 使用 Python PIL 调整大小的图像较暗

c++ - 绘制 vector <glm::vec3> opengl c++

javascript - WebGL 显示加载的没有矩阵的模型

c++ - 使用 STL 时出现段错误

C 段错误 : 11

python - Argparse 确认

python - 如何用破折号替换嵌套的短语列表?