[PyOpenGL-Users] font-rendering problem
Brought to you by:
mcfletch
From: vwf <vw...@vu...> - 2009-04-15 17:47:36
|
Hello Python-OpenGL Experts, I keep having problems with a part of my program. This program once worked, but stopped working after an upgrade of my system. Can someone help me get it running again? The problem appears in the initialisation phase of the program, during the "prerendering" of the fonts. Thank you, Frits mine:~/fppu/manavnew$ ./manav_01.py Traceback (most recent call last): File "./manav_01.py", line 22, in <module> from networking import * File "/home/frits/fppu/manavnew/networking.py", line 17, in <module> from constant_manav import state,scen File "/home/frits/fppu/manavnew/constant_manav.py", line 119, in <module> class cfont: File "/home/frits/fppu/manavnew/constant_manav.py", line 123, in cfont l1.build('0123456789.') File "/home/frits/fppu/manavnew/pyfont.py", line 97, in build l=self.font.getChar(c) File "/home/frits/fppu/manavnew/pyfont.py", line 127, in getChar current = self.createChar(char) File "/home/frits/fppu/manavnew/pyfont.py", line 150, in createChar list = self.textureToList( dataArray, metrics ) File "/home/frits/fppu/manavnew/pyfont.py", line 188, in textureToList raise File "/home/frits/fppu/manavnew/pyfont.py", line 183, in textureToList glDrawPixelsub( mode, array ) File "/var/lib/python-support/python2.5/OpenGL/wrapper.py", line 1273, in __call__ return self.finalise()( *args, **named ) File "/var/lib/python-support/python2.5/OpenGL/wrapper.py", line 469, in wrapperCall pyArgs = tuple( calculate_pyArgs( args )) File "/var/lib/python-support/python2.5/OpenGL/wrapper.py", line 328, in calculate_pyArgs yield converter(args[index], self, args) File "/var/lib/python-support/python2.5/OpenGL/GL/images.py", line 422, in __call__ return self.arrayType.asArray( arg ) File "/var/lib/python-support/python2.5/OpenGL/arrays/arraydatatype.py", line 55, in asArray return cls.getHandler(value).asArray( value, typeCode or cls.typeConstant ) File "/var/lib/python-support/python2.5/OpenGL/arrays/arraydatatype.py", line 25, in getHandler return cls.getHandler( value ) File "/var/lib/python-support/python2.5/OpenGL/arrays/formathandler.py", line 16, in __call__ typ = value.__class__ AttributeError: ('__class__', <OpenGL.GL.images.TypedImageInputConverter object at 0xba1150c>) The offending code: # Adapted from: # OpenGLContext 2.0.0b2 # # OpenGLContext License: # # Copyright (c) 2000-2003, Michael C. Fletcher and Contributors # All rights reserved. [...] def textureToList( self, array, metrics): # Compile Numeric Python array to a display-list # use a single texture and coordinates for texmap version # special case ' ' so that it's not rendered as an image mode = GL_LUMINANCE_ALPHA list = glGenLists (1) glNewList( list, GL_COMPILE ) try: try: if metrics.char != ' ': glDrawPixelsub( mode, array ) glBitmap( 0,0,0,0, metrics.width,0, None ) #glDisable( GL_BLEND) except Exception: glDeleteLists( list, 1 ) raise finally: glEndList() return list All on Debian Lenny (stable/5.0) python: Installed: 2.5.2-3 python-opengl: Installed: 3.0.0~c1-0 |