2012-04-28 2 views
0

은 내가 마우스 버튼 클릭을 듣고 glutMouseFunc를 사용하는 PyOpenGL 프로그램을 작성하고 실행할 수 오전 64 비트 파이썬 3.x 및 윈도우 7에 대한 here에서 PyOpenGL설치 한 :PyOpenGL 프로그램에서 FreeGLUT glutMouseWheelFunc를 사용하는 방법은 무엇입니까?

from OpenGL.GLUT import * 
from OpenGL.GL import * 

# Imagine the typical glut init functions here ... 
glutMouseFunc(mouse) 

이제 마우스의 스크롤 휠을 읽고 싶습니다. 나는 이것을 C++에서 FreeGLUT을 사용하여 수행했다. FreeGLUT은 glutMouseWheelFunc을 노출한다. 확인하고 볼 수 있습니다. freeglut32.vc9.dllfreeglut64.vc9.dll : C:\Program Files\Python32\Lib\site-packages\OpenGL\DLLS.

File "c:\Program Files\Python32\lib\site-packages\OpenGL\GLUT\special.py", line 139, in __call__ 
    self.wrappedOperation(cCallback, *args) 
    File "c:\Program Files\Python32\lib\site-packages\OpenGL\GLUT\special.py", line 107, in failFunction 
    typeName, 'glut%sFunc'%(typeName), 
OpenGL.error.NullFunctionError: Undefined GLUT callback function MouseWheel, check for bool(glutMouseWheelFunc) before calling 

그래서, 가 어떻게 FreeGLUT이 PyOpenGL에서 호출을 사용합니까 :이 오류와 함께

from OpenGL.GLUT import * 
from OpenGL.GLUT.freeglut import * 
from OpenGL.GL import * 

# Imagine the typical glut init functions here ... 
glutMouseFunc(mouse) 
glutMouseWheelFunc(mouseWheel) 

이 실패

나는에 위의 코드를 변경? 내가 뭘 잘못하고 있니?

답변

0

PyOpenGL은 기본적으로 GLUT dll을로드합니다. 대신에 freeglut을 사용하려면 OpenGL/DLLs 디렉토리에서 glut64.vc9.dll 파일의 이름을 변경하거나 삭제하고 Windows DLL 검색 경로의 다른 위치에 해당 파일이 없는지 확인하십시오. 나를 위해 일합니다.

관련 문제