[PyOpenGL-Users] Possible 64 bit bug
Brought to you by:
mcfletch
|
From: Zack S. <zac...@gm...> - 2009-07-01 20:01:38
|
I'm developing a game with Pygame, Numpy, and PyOpenGL and I've come
across a bug in what I think is PyOpenGL (though it may not be). I've
only seen the bug present under Windows Vista 64. The machine in
question was equipped with a Radeon 4870 and the most up-to-date
drivers. Unfortunately, the machine is not mine, so I can't give more
details.
Anyway, my game runs fine, including Numpy generated VBOs and other
fancy stuff, but it crashes when I initialize a simple object called
the LinkLine. The LinkLine object uses immediate mode to draw GL_LINES
between two in-game objects. It works fine on every system I've ever
tried (Mac OS, Linux, Windows, nVidia/ATI/Intel/Software) except for
machines running Vista 64. When I try to draw the link line, the game
crashes with an access violation. Here's a breakdown of the crash:
Execution traces back to LinkLine.py, line 55, in the draw method.
WindowsError: Exception: access violation writing 0x00000008
Here's what's written on line 55:
glColor4f(self.color[0],self.color[1],self.color[2],self.color[3])
Basically, I'm setting the current RGBA color using 4 floats stored in
a tuple.
The color tuple is set by this line:
self.color = color
Referencing a calling argument in the constructor:
def
__init__
(self
,spawnpoint,obj1,obj2,color=(0,0,0,1),thickness=2.0,additive=False):
Which in the specific case of the crash is constructed here:
gameinfo.spawnobj(create("LinkLine",
(0,0
),self
.deadplayer
,self.tempwall,color=(0,0,0.4,0.6),additive=True,thickness=12))
In short, I create the tuple "color=(0,0,0.4,0.6)" and pass it on down
the chain until it gets pulled apart and set with glColor4f. I perform
this same operation on tons of objects in my game. The same exact code
works in other places. Why not here?
How would I go about debugging this further? Any tips on what could
be wrong? This is a real mystery to me.
Thanks,
-Zack
For reference, here's the whole draw function of LinkLine. It's very
straightforward.
def draw(self):
glDisable(GL_TEXTURE_2D)
glLineWidth(self.thickness)
if self.additive:
glColor4f(0,0,0,0.02)
glBegin(GL_LINES)
glVertex3f(self.obj1.positionx, self.obj1.positiony,
self.obj1.positionz)
glVertex3f(self.obj2.positionx, self.obj2.positiony,
self.obj2.positionz)
glEnd()
glBlendFunc(GL_SRC_ALPHA, GL_ONE)
glColor4f(self.color[0],self.color[1],self.color[2],self.color[3])
glBegin(GL_LINES)
glVertex3f(self.obj1.positionx, self.obj1.positiony,
self.obj1.positionz)
glVertex3f(self.obj2.positionx, self.obj2.positiony,
self.obj2.positionz)
glEnd()
# Set the drawing state back up the way it should be.
glColor4f(1,1,1,1)
if self.additive:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
glEnable(GL_TEXTURE_2D)
|