2013-03-07 30 views
4

我在使用英特尔HD 3000图形芯片组的Windows 8 64位笔记本电脑上发生PyOpenGL 3.0.2问题。到glGenBuffers(1)任何呼叫(GL正确初始化后)崩溃:英特尔高清显卡3000上PyOpenGL访问冲突

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() 
+0

[从Python调用OpenGL扩展]可能的副本(http://stackoverflow.com/questions/6423994/calling-opengl-extensions-from-python) – genpfault 2013-03-07 19:05:05

+0

我不认为它是'glGenBuffers'在'OpenGL.GL。*',而不是'OpenGL.GL.ARB。*'。另外,我的系统上没有'OpenGL.GL.ARB.vertex_buffer_object'。 – 2013-03-08 10:32:05

回答

1

我终于解决了这个问题,卸载了我的整个Python 64位发行版,并安装了Python 32位和32位的所有库。另外我不得不使用PyOpenGL 3.1.a.我不知道是什么原因造成了64位安装的问题。

1

即使你的驱动程序支持OpenGL 3.1,转运蛋白是要给你默认一个OpenGL 2.0上下文。你将要问一个3.1 cpntext,大概是这个样子:

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

没有适当的3.1范围内,任何特定的3.1调用将导致你崩溃。

+1

我只是试过,我有完全相同的问题。另外,我也遇到与PyQt4(使用QGLWidget)相同的问题,所以我不认为它是特定于Glut的。 – 2013-03-07 23:47:20

+0

这不是Glut特定的。在大多数平台上,当你启动OpenGL时,你最多只能有一个2.x上下文。如果您尝试在没有正确的上下文的情况下使用3.x功能,则会崩溃。 – 2013-03-08 00:13:57

+0

好的。我有两个问题,但: *当我做'glGetString(GL_VERSION)'我得到OpenGL 3.1:确保OpenGL 3.1真的被加载?如果不是,我怎么知道确切的版本? *我认为'glGenBuffers'是核心的OpenGL 1.5,所以它应该工作,无论我有OpenGL 2还是OpenGL 3.1,对吧? – 2013-03-08 09:54:53