I am learning OpenGL as part of a computer graphics course using JOGL.
I have a JFrame, whose content pane has a main panel I have created with a cardlayout. To this panel, I add 2 panels ( one for animation and one to show matrix transformations ). Both of these panels ( are in their own class ) creates a GLJPanel to do the OpenGL calls. But when I add these 2 panels to the main panel ( card layout ), I get an exception when the frame is displayed.
net.java.games.jogl.GLException: Error creating offscreen bitmap
at net.java.games.jogl.impl.windows.WindowsOffscreenGLContext.create(WindowsOffscreenGLContext.java:150)
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:1665)
at java.awt.BorderLayout.layoutContainer(BorderLayout.java:683)
at java.awt.Container.layout(Container.java:1017)
Any ideas ?