我正在学习使用 JOGL,在学习本教程时遇到了问题:
- https://sites.google.com/site/justinscsstuff/jogl-tutorial-1
- https://sites.google.com/site/justinscsstuff/jogl-tutorial-2
- https://sites.google.com/site/justinscsstuff/jogl-tutorial-3
在第三个教程中运行代码时,我看到了一个预期的三角形,但它没有移动。我也遇到了这个错误。
Exception in thread "main" java.lang.IllegalArgumentException: Drawable already added to animator: com.jogamp.opengl.util.Animator[started false, animating false, paused false, drawable 1, totals[dt 0, frames 0, fps 0.0], modeBits 1, init'ed true, animThread null, exclCtxThread false(null)], AWT-GLCanvas[Realized true,
jogamp.opengl.windows.wgl.WindowsOnscreenWGLDrawable,
Factory jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory@1e71839,
handle 0x0,
Drawable size 292x273,
AWT pos 4/23, size 292x273,
visible true, displayable true,
AWTGraphicsConfiguration[AWTGraphicsScreen[AWTGraphicsDevice[type .awt, connection \Display1, unitID 0, awtDevice D3DGraphicsDevice[screen=1], handle 0x0], idx 1],
chosen GLCaps[wgl vid 0x7 arb: rgba 8/8/8/0, trans-rgba 0x0/0/0/0, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
sun.awt.Win32GraphicsConfig@300ca7[dev=D3DGraphicsDevice[screen=1],pixfmt=7],
encapsulated WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], idx 1], pfdID 7, ARB-Choosen true,
requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
chosen GLCaps[wgl vid 0x7 arb: rgba 8/8/8/0, trans-rgba 0x0/0/0/0, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]]]]
at com.jogamp.opengl.util.AnimatorBase.add(AnimatorBase.java:183)
at SimpleScene.main(SimpleScene.java:33)
在教程的第一部分,当设置我的课程路径时,我找到了jogl-all.jar
andgluegen.jar
但我找不到nativewindow.all.jar
ornewt.all.jar
所以我选择了最接近的我能找到的是jogl-all-natives-windows-amd64.jar
and newt-natives-windows-amd64.jar
。(我什至不认为我需要 newt 因为我认为这只是允许我使用除标准 AWT 框架之外的其他类型的框架。如果我错了,请纠正我。)这可能与问题有关吗?