I have just started learning jogl and need some help.
Here is my code:
public class Test {
static GLCapabilities gl_Capabilities = new GLCapabilities();
public static void main(String[] args){
// gl_Capabilities.setRedBits(8);
// gl_Capabilities.setBlueBits(8);
// gl_Capabilities.setGreenBits(8);
// gl_Capabilities.setAlphaBits(8);
GLCanvas gl_canvas = GLDrawableFactory.getFactory().createGLCanvas(gl_Capabilities);
GLJPanel gl_panel = GLDrawableFactory.getFactory().createGLJPanel(gl_Capabilities,gl_canvas);
Frame frame = new Frame();
frame.add(gl_panel);
frame.setVisible(true);
frame.setSize(400,400);
}
}
And whenever this is ran, i get this error:
net.java.games.jogl.GLException: Error creating offscreen bitmap
at net.java.games.jogl.impl.windows.WindowsOffscreenGLContext.create(WindowsOffscreenGLContext.java:147)
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(Unknown Source)
at java.awt.BorderLayout.layoutContainer(Unknown Source)
at java.awt.Container.layout(Unknown Source)
at java.awt.Container.doLayout(Unknown Source)
at java.awt.Container.validateTree(Unknown Source)
at java.awt.Container.validate(Unknown Source)
at java.awt.Window.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at Test.main(JoglFrame.java:45)
Line 45: frame.add(gl_panel);
Can someone tell me what is occurring?
Thanks,
Zak