GraphicsConfiguration exception in GLCanvas

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GraphicsConfiguration exception in GLCanvas

manuelddahmen
This post was updated on .
I got a Exception in JFrame setVisible
Index out of bonds - 1 of length 1.
I don't know what's wrong.
https://github.com/manuelddahmen/empty3/blob/android/src/main/java/one/empty3/apps/opad/JoglDrawer.java
"C:\Program Files\jdk-16\bin\java.exe" -javaagent:C:\Users\manue\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\212.5457.46\lib\idea_rt.jar=62134:C:\Users\manue\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\212.5457.46\bin -Dfile.encoding=UTF-8 -classpath C:\Users\manue\IdeaProjects\empty3-android\target\classes;C:\Users\manue\IdeaProjects\empty3-android\lib\miglayout-swing.jar;C:\Users\manue\IdeaProjects\empty3-android\lib\miglayout-core.jar;C:\Users\manue\.m2\repository\com\badlogicgames\gdx\gdx\1.9.10\gdx-1.9.10.jar;C:\Users\manue\.m2\repository\org\jcodec\jcodec-javase\0.2.5\jcodec-javase-0.2.5.jar;C:\Users\manue\.m2\repository\org\jcodec\jcodec\0.2.5\jcodec-0.2.5.jar;C:\Users\manue\.m2\repository\com\miglayout\miglayout-swing\5.0\miglayout-swing-5.0.jar;C:\Users\manue\.m2\repository\com\miglayout\miglayout-core\5.0\miglayout-core-5.0.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all-main\2.3.2\jogl-all-main-2.3.2.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt-main\2.3.2\gluegen-rt-main-2.3.2.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-android-aarch64.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-android-armv6.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-linux-amd64.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-linux-armv6.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-linux-armv6hf.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-linux-i586.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-macosx-universal.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-solaris-amd64.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-solaris-i586.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-windows-amd64.jar;C:\Users\manue\.m2\repository\org\jogamp\jogl\jogl-all\2.3.2\jogl-all-2.3.2-natives-windows-i586.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-android-aarch64.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-android-armv6.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-linux-amd64.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-linux-armv6.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-linux-armv6hf.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-linux-i586.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-macosx-universal.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-solaris-amd64.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-solaris-i586.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-windows-amd64.jar;C:\Users\manue\.m2\repository\org\jogamp\gluegen\gluegen-rt\2.3.2\gluegen-rt-2.3.2-natives-windows-i586.jar one.empty3.apps.opad.PanelGraphics
0
oct. 16, 2021 9:21:52 PM one.empty3.apps.opad.DarkFortressGUI setLevel
INFO: JoglDrawer
oct. 16, 2021 9:21:53 PM one.empty3.apps.opad.Drawer setLevel
INFO: Level: one.empty3.apps.opad.SolPlan
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 1
        at jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:171)
        at com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
        at com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1560)
        at com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:611)
        at java.desktop/java.awt.Container.addNotify(Container.java:2801)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
        at java.desktop/java.awt.Container.addNotify(Container.java:2801)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
        at java.desktop/java.awt.Container.addNotify(Container.java:2801)
        at java.desktop/javax.swing.JComponent.addNotify(JComponent.java:4792)
        at java.desktop/javax.swing.JRootPane.addNotify(JRootPane.java:729)
        at java.desktop/java.awt.Container.addNotify(Container.java:2801)
        at java.desktop/java.awt.Window.addNotify(Window.java:787)
        at java.desktop/java.awt.Frame.addNotify(Frame.java:493)
        at java.desktop/java.awt.Window.show(Window.java:1049)
        at java.desktop/java.awt.Component.show(Component.java:1720)
        at java.desktop/java.awt.Component.setVisible(Component.java:1667)
        at java.desktop/java.awt.Window.setVisible(Window.java:1032)
        at one.empty3.apps.opad.DarkFortressGUI.setLevel(DarkFortressGUI.java:115)
        at one.empty3.apps.opad.PanelGraphics.jButton1ActionPerformed(PanelGraphics.java:317)
        at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
        at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
        at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
        at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
        at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
        at java.desktop/java.awt.Component.processMouseEvent(Component.java:6617)
        at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3342)
        at java.desktop/java.awt.Component.processEvent(Component.java:6382)
        at java.desktop/java.awt.Container.processEvent(Container.java:2264)
        at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4993)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2322)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
        at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4934)
        at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4563)
        at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4504)
        at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2308)
        at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
        at java.desktop/java.awt.Component.dispatchEvent(Component.java:4825)
        at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
        at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Process finished with exit code 0




Code.



public class JoglDrawer extends Drawer implements GLEventListener {
    private GLU glu;
    private final Frame component;
    private FPSAnimator animator;
    double INCR_AA = 0.01;
    double DISTANCE_MIN = 100;
    Timer timer;
    private double maximize = INCR_AA / 10;
    private double minimize = INCR_AA;
    private PositionUpdate mover;
    private Terrain terrain;
    private Bonus bonus;
    private TextRenderer renderer;
    private Vaisseau vaisseau;
    private boolean locked;
    private Circuit circuit;
    private int BUFSIZE;
    private Point2D pickPoint;
    private PiloteAuto piloteAuto;
    private Point3D del;
    private Point3D diff;
    private GL2 gl;
    private GLCanvas glCanvas;
    private Plotter3D plotter3D;
    {
        Plasma.scale = 2;
        Plasma.t_factor = 0.000001;
    }

    {
    }

    public JoglDrawer(DarkFortressGUI darkFortressGUI) {

        //getting the capabilities object of GL2 profile

        GLProfile.initSingleton();

        final GLProfile profile = GLProfile.get(GLProfile.GL4);
        GLCapabilities capabilities = new GLCapabilities(profile);

        // The canvas
        glCanvas = new GLCanvas(capabilities);
        glCanvas.setSize(640, 480);
        glCanvas.setAutoSwapBufferMode(true);
        glCanvas.setGL(gl);
        glCanvas.addGLEventListener(this);



        // Create a animator that drives canvas' display() at the specified FPS.
        animator = new FPSAnimator(25);
        glCanvas.setAnimator(animator);

        mover = darkFortressGUI.mover;


        initFrame(darkFortressGUI);

        this.component = darkFortressGUI;

        //JPanel panel = new JPanel();

        //panel.setMinimumSize(new Dimension(640, 480));
        //panel.setSize(640, 480);
        //        panel.add(glCanvas);
        //((JFrame)component).add(panel);

        timer = new Timer();
        timer.init();

        ((JFrame)component).getContentPane().add(glCanvas);

    }
 
Reply | Threaded
Open this post in threaded view
|

Re: GraphicsConfiguration exception in GLCanvas

gouessej
Administrator