我是JOGL的新手,所以请原谅我的无知,如果这是一个愚蠢的问题。
我有一个Java应用程序,我有一个GLCanvas正确呈现到JFrame。我的问题是我想将这个GLCanvas放在同一个EDT中的不同对话框/框架中。
让我谈谈这个问题。
Screenshot.readToBufferedImage(width, height)
例程创建的gl场景的图像; EventQueue.invokeLater()
例程调用。这就是我想要的第一次迭代。但是,如果我再次尝试更改方向,或者我退出并返回到主机并尝试旋转或缩放场景,我会遇到以下崩溃:
Process: java [21036]
Path: /usr/bin/java
Identifier: com.apple.javajdk16.cmd
Version: 1.0 (1.0)
Code Type: X86-64 (Native)
Parent Process: java [20310]
PlugIn Path: /Users/matthewalderson/.netbeans/7.1.2/jogl-runtime/jogl.jar-natives-macosx-universal/libjogl.jnilib
PlugIn Identifier: libjogl.jnilib
PlugIn Version: ??? (???)
Date/Time: 2015-10-03 15:27:27.061 -0300
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008
Crashed Thread: 17 Java: AWT-EventQueue-0
Application Specific Information:
Java information:
Exception type: Bus Error (0xa) at pc=129df776d
Java VM: Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode macosx-amd64)
Current thread (1040ac800): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=691781632, stack(1292bc000,1293bc000)]
Stack: [1292bc000,1293bc000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.opengl.impl.GLImpl.glDrawArrays(III)V+0
j com.protocase.space.gl.VBOList.render(Ljavax/media/opengl/GL;)V+140
j com.protocase.viewer.rendering.RenderVBOsVisitor.renderTopVBO(Lcom/protocase/things/solids/Solid;)V+96
j com.protocase.viewer.rendering.RenderVBOsVisitor.renderSolidVBOs(Lcom/protocase/things/solids/Solid;)V+2
j com.protocase.viewer.rendering.RenderVBOsVisitor.visitOneThing3D(Lcom/protocase/things/Thing3D;)V+128
j com.protocase.viewer.rendering.RenderVBOsVisitor.visitThing3Ds(Lcom/protocase/things/Thing3D;)V+108
j com.protocase.viewer.rendering.RenderVBOsVisitor.visitChildren(Lcom/protocase/things/Thing3D;)V+43
j com.protocase.viewer.rendering.RenderVBOsVisitor.visitThing3Ds(Lcom/protocase/things/Thing3D;)V+113
j com.protocase.viewer.rendering.RenderVBOsVisitor.visitChildren(Lcom/protocase/things/Thing3D;)V+43
j com.protocase.viewer.rendering.RenderVBOsVisitor.visitThing3Ds(Lcom/protocase/things/Thing3D;)V+113
j com.protocase.viewer.rendering.RenderVBOsVisitor.performOn(Lcom/protocase/things/Assembly;Ljavax/media/opengl/GL;Lcom/protocase/space/gl/GLPropertyModel;Lcom/protocase/space/gl/GLGraphicsManager;)V+58
j com.protocase.space.gl.GLRenderVBOsState.renderGL(Ljavax/media/opengl/GL;Lcom/protocase/space/gl/GLGraphicsManager;)V+23
j com.protocase.space.gl.GLRenderState.renderVisibleLines(Ljavax/media/opengl/GL;ZLcom/protocase/space/gl/GLGraphicsManager;)V+60
j com.protocase.space.gl.GLRenderState.renderGLFill(Ljavax/media/opengl/GL;Lcom/protocase/space/gl/GLGraphicsManager;)V+20
j com.protocase.space.gl.GLRenderState.render(Ljavax/media/opengl/GL;Lcom/protocase/space/gl/GLGraphicsManager;)V+33
j com.protocase.space.gl.GLRenderState.run(Ljavax/media/opengl/GL;)V+13
j com.protocase.viewer.rendering.Renderer3D.display(Ljavax/media/opengl/GLAutoDrawable;)V+83
j com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V+29
J javax.media.opengl.GLJPanel$Updater.display(Ljavax/media/opengl/GLAutoDrawable;)V
j com.sun.opengl.impl.GLDrawableHelper.display(Ljavax/media/opengl/GLAutoDrawable;)V+29
j com.sun.opengl.impl.GLPbufferImpl$DisplayAction.run()V+11
j com.sun.opengl.impl.GLDrawableHelper.invokeGL(Ljavax/media/opengl/GLDrawable;Ljavax/media/opengl/GLContext;Ljava/lang/Runnable;Ljava/lang/Runnable;)V+418
j com.sun.opengl.impl.GLPbufferImpl.maybeDoSingleThreadedWorkaround(Ljava/lang/Runnable;Ljava/lang/Runnable;Z)V+36
j com.sun.opengl.impl.GLPbufferImpl.display()V+10
j javax.media.opengl.GLJPanel.paintComponent(Ljava/awt/Graphics;)V+237
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+290
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+512
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+322
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+512
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+322
j javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73
j javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+512
j javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+322
j java.awt.GraphicsCallback$PaintCallback.run(Ljava/awt/Component;Ljava/awt/Graphics;)V+27
j sun.awt.SunGraphicsCallback.runOneComponent(Ljava/awt/Component;Ljava/awt/Rectangle;Ljava/awt/Graphics;Ljava/awt/Shape;I)V+155
j sun.awt.SunGraphicsCallback.runComponents([Ljava/awt/Component;Ljava/awt/Graphics;I)V+104
j java.awt.Container.paint(Ljava/awt/Graphics;)V+98
j java.awt.Window.paint(Ljava/awt/Graphics;)V+72
j sun.awt.RepaintArea.paintComponent(Ljava/awt/Component;Ljava/awt/Graphics;)V+6
j sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+368
j apple.awt.ComponentModel.handleEvent(Ljava/awt/AWTEvent;)V+70
j apple.awt.CWindow.handleEvent(Ljava/awt/AWTEvent;)V+95
j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+861
j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
j java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+65
j java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j java.awt.EventQueue.dispatchEventImpl(Ljava/awt/AWTEvent;Ljava/lang/Object;)V+41
j java.awt.EventQueue.access$400(Ljava/awt/EventQueue;Ljava/awt/AWTEvent;Ljava/lang/Object;)V+3
j java.awt.EventQueue$2.run()Ljava/lang/Void;+12
j java.awt.EventQueue$2.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+6
j java.awt.EventQueue$3.run()Ljava/lang/Void;+11
j java.awt.EventQueue$3.run()Ljava/lang/Object;+1
v ~StubRoutines::call_stub
j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;+0
j java.security.AccessControlContext$1.doIntersectionPrivilege(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;Ljava/security/AccessControlContext;)Ljava/lang/Object;+28
j java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+73
j java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204
j java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V+30
j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11
j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j java.awt.EventDispatchThread.run()V+9
v ~StubRoutines::call_stub
我不确定这是否足以提供合理的答案,但任何帮助都会有所帮助。
更多笔记:
EventQueue.invokeLater
,则场景的背景渲染,而不是实际的几何对象