python – Intel HD Graphics 3000上的PyOpenGL访问冲突

我在使用Intel HD 3000图形芯片组的
Windows 8 64位笔记本电脑上遇到了PyOpenGL 3.0.2的问题.任何对glGenBuffers(1)的调用(在正确的GL初始化之后)都会崩溃:

  File ".\sample.py", line 7, in init
    buffer = glGenBuffers(1)
  File "latebind.pyx", line 32, in OpenGL_accelerate.latebind.LateBind.__call__ (src\latebind.c:768)
  File "wrapper.pyx", line 308, in OpenGL_accelerate.wrapper.Wrapper.__call__ (src\wrapper.c:5811)
  File "C:\Python27\lib\site-packages\OpenGL\platform\baseplatform.py", line 379, in __call__
    return self( *args, **named )
WindowsError: exception: access violation writing 0x00000000720CF630

完全相同的脚本适用于其他计算机.

我有最新版本的GPU驱动程序(15.28.12.64.2932),它支持OpenGL 3.1.

有任何想法吗?

以下是示例脚本:

import sys
from OpenGL.GLUT import *
from OpenGL.GL import *
from OpenGL.GLU import *

def init():
    buffer = glGenBuffers(1)

glutInit(sys.argv)
glutInitWindowSize(600, 600)
glutCreateWindow("Sample")
init()
glutMainLoop()

最佳答案 即使您的驱动程序支持OpenGl 3.1,Glut默认会为您提供OpenGL 2.0上下文.你将不得不要求3.1 cpntext,可能是这样的:

glutInitContextVersion(3, 1) 
glutInitContextFlags(GLUT_FORWARD_COMPATIBLE) 
glutInitContextProfile(GLUT_CORE_PROFILE)

没有适当的3.1上下文,任何3.1特定的调用都会导致崩溃.

点赞