Game Programming with Python trouble
Posted by kudu (kudu), 23 October 2005Hi,
Whilst I realize the book's focus is on Windows, I'm trying to get the example programs running on my Linux box. I'm stumbling on the lack of WGL__init__.
Here's what I get:
>>> Running '/home/kudu/python/gpwp/chapter4/main.py' ...
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/_spe/sm/scriptutils.py", line 49, in run
exec codeObject in mainDict
File "<source>", line 49, in ?
File "<source>", line 43, in run
File "/usr/lib/python2.4/site-packages/pyui/core.py", line 65, in init
from renderers.openglPygame import OpenGLPygame
File "/usr/lib/python2.4/site-packages/pyui/renderers/openglPygame.py", line 25, in ?
from pyui.renderers import openglBase
File "/usr/lib/python2.4/site-packages/pyui/renderers/openglBase.py", line 49, in ?
from OpenGL.WGL import wglUseFontBitmaps, wglGetCurrentDC
File "/usr/lib/python2.4/site-packages/OpenGL/WGL/__init__.py", line 2, in ?
from WGL__init__ import *
ImportError: No module named WGL__init__
Exception raised while running script <source>
Is there any way to get the example code running on my setup ??
Posted by admin (Graham Ellis), 25 October 2005I'm on thin ice here, but it looks to me that this is a Windows Open GL call from within pyopengl. In which case, your solution is likely to be a configuration change or different version of that module which calls the Linux / X windows equivalents. I see from the top page of the Pyopengl documentation that it builds on quite a range of lower level graphics drivers, of which WGL is but one.
Posted by kudu (kudu), 25 October 2005Hi Graham,
Yes you're right. I got it sorted by hashing out the offending line that calls WGL __ini__, which has to do with loading Windows fonts if running in Windows OS. But since I'm not running on Windows and that module doesn't therefore exist it puked. Now it runs correctly.
Thank you for responding, very much appreciated.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho