I just copied Test.java and TestRenderer.java from “How to: Getting started with JOGL” and everything works fine.
Anyway when I change this line
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(glCaps);
with this one:
GLJPanel canvas = GLDrawableFactory.getFactory().createGLJPanel(glCaps);
things stop working and I get this exception:
net.java.games.jogl.GLException: Unable to set pixel format
at net.java.games.jogl.impl.windows.WindowsGLContext.choosePixelFormatAndCreateContext(WindowsGLContext.java:286)
at net.java.games.jogl.impl.windows.WindowsOffscreenGLContext.create(WindowsOffscreenGLContext.java:157)
at net.java.games.jogl.impl.windows.WindowsGLContext.makeCurrent(WindowsGLContext.java:117)
at net.java.games.jogl.impl.windows.WindowsOffscreenGLContext.makeCurrent(WindowsOffscreenGLContext.java:116)
at net.java.games.jogl.impl.GLContext.invokeGL(GLContext.java:162)
at net.java.games.jogl.GLJPanel.reshape(GLJPanel.java:131)
at java.awt.Component.setBounds(Component.java:1664)
at java.awt.BorderLayout.layoutContainer(BorderLayout.java:691)
at java.awt.Container.layout(Container.java:1020)
at java.awt.Container.doLayout(Container.java:1010)
at java.awt.Container.validateTree(Container.java:1092)
at java.awt.Container.validateTree(Container.java:1099)
at java.awt.Container.validateTree(Container.java:1099)
at java.awt.Container.validateTree(Container.java:1099)
at java.awt.Container.validate(Container.java:1067)
at java.awt.Window.show(Window.java:461)
at com.compleasy.as.lab.jogl.Test.main(Test.java:50)
If I delete these lines:
glCaps.setRedBits(8);
glCaps.setBlueBits(8);
glCaps.setGreenBits(8);
glCaps.setAlphaBits(8);
nothing changes.
Has anyone been able to use GLJPanel ?
I tryed all sort of things without any success.
Thanks,
Antonio
P.S.: I’m using a GeForce3 on w2k, jdk 1.4.2-b28