I'm trying to use jogl from Jython. I tried the demo at:
http://wiki.python.org/jython/JythonMonthly/Articles/January2007/2This got me a nice segmentation fault. So, I backed up and tried a
plain java JOGL demo. That works fine and validates that I have JOGL
installed correctly.
So, then I tried to isolate a bunch of stuff. After chopping a lot of
the code away, I noticed that the "reshape" function is being called
multiple times with *different number of arguments*.
I can obviously just test for the number of arguments, but do I *really*
want to do this? It seems like something is fundamentally flawed with
this approach. Why is reshape being called with two different numbers
of arguments? Is this expected?
Code follows.
Thanks,
-a
from javax.swing import *
from java.awt import *
from javax.media.opengl import *
from java.lang import InterruptedException
from java.lang import Thread
class GLPanel2A(JPanel, GLEventListener):
def __init__(self):
print "GLPanel __init__..."
self.canvas = GLCanvas()
self.canvas.addGLEventListener(self)
self.add(self.canvas)
self.setSize(320,480)
self.canvas.setSize(320,480)
self.canvas.setVisible(True)
def init(self, glDrawable):
print "GLPanel init..."
def reshape(self, *a):
print "Reshape... Numargs:", len(a)
print a
def display(self, *a):
print "Display... Numargs:", len(a)
print a
class JOGLTest(JFrame):
def __init__(self):
print "__init__..."
self.running = False
self.animThread = None
self.a = None
self.b = None
def init(self):
print "init..."
glPanelA = GLPanel2A()
self.getContentPane().add(glPanelA)
self.a = glPanelA
if __name__== "__main__":
jogl = JOGLTest()
jogl.init()
jogl.setSize(400, 400)
jogl.visible = True
while (True):
try:
Thread.sleep(100)
except InterruptedException, e:
raise
------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to:
http://p.sf.net/sfu/opensolaris-get_______________________________________________
Jython-users mailing list
Jython-users@...
https://lists.sourceforge.net/lists/listinfo/jython-users