def glPrint(x, y, texttodisplay):
glBindTexture(GL_TEXTURE_2D, textures[4])
glPushMatrix()
glLoadIdentity()
glTranslated(x,y,0)
glListBase(base-31)
listt = texttodisplay.split()
glCallLists(texttodisplay)
glPopMatrix()
def BuildFont():
base=glGenLists(95)
glBindTexture(GL_TEXTURE_2D, textures[4])
for loop in range(0,95):
cx=float(loop%16)/16.0
cy=float(loop/16)/8.0
glNewList(base+loop,GL_COMPILE)
glBegin(GL_QUADS)
glTexCoord2f(cx, 1.0-cy-0.120)
glVertex2i(0,0)
glTexCoord2f(cx+0.0625, 1.0-cy-0.120)
glVertex2i(16,0)
glTexCoord2f(cx+0.0625, 1.0-cy)
glVertex2i(16,16)
glTexCoord2f(cx, 1.0-cy)
glVertex2i(0,16)
glEnd()
glTranslated(10,0,0)
glEndList()
strange problem with gl and python
hello all.
i'm using opengl & sdl & python.
i'm putting a text on the screen (which works fine in LINUX)
but when i put the code and run it in windows
it give me some error about unsigned int (that the function glListBase gets -31 or somthing like that)
here is the code:
the problem is in the function glprint.
i can see the text and it works really fine in linux
but just as i said before when i run this python code in windows..
it crashes and give me that error msg about unsigned int.
anyone knows how can i fix this?
thanks in advance
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement