From: Josh J. <jun...@gm...> - 2009-06-05 17:51:15
|
I'm glad to hear that you tried out the sample, sorry to hear that it failed for you. I went back and ran the same code that I posted in my sample on a different machine and also had a seg fault. This is perhaps due to a different JDK since I tried to run it on a Mac this time. It may also be due to a different version of JOGL. Sorry that I'm no expert in JOGL so I cannot say for certain. I agree with Marc's response that reshape() is implemented different ways within the JComponent and GLEventListener...that's probably why you get the different # of args...but I can't be sure without digging more deeply into the code. Hope that you're able to work something out to overcome the issues. Best Josh Juneau jun...@gm... http://jj-blogger.blogspot.com http://www.gathereventplanning.com Twitter ID: javajuneau On Thu, Jun 4, 2009 at 6:27 PM, Andrew Lentvorski <bs...@al...> wrote: > I'm trying to use jogl from Jython. I tried the demo at: > http://wiki.python.org/jython/JythonMonthly/Articles/January2007/2 > > This 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 > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |