Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Error in attaching canvas to a Frame  (Read 2266 times)
0 Members and 1 Guest are viewing this topic.
Offline zaknixon

Senior Newbie




</bored>


« Posted 2003-07-22 12:29:43 »

I have just started learning jogl and need some help.

Here is my code:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
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:


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
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



----------------------------------
Zak Nixon
Software Engineer
Davidson Technologies
-----------------------------------
Offline AndersDahlberg

Junior Devvie





« Reply #1 - Posted 2003-07-22 13:02:10 »

Some quick question so that the pro's Grin can help you better:

1, Do you have a 3d card? Wink
2, Do you use windows xp with default drivers? (if so, update as windows don't provide opengl support)
3, Do you use linux without native (nvidia,ati etc) drivers?

These above are maybe not your problem - but easier to get them answered directly, so that it's easier to solve the real problem later Smiley
Offline zaknixon

Senior Newbie




</bored>


« Reply #2 - Posted 2003-07-22 13:05:35 »

Quote
1, Do you have a 3d card?  


Yes, I am using a Nvidia Quadro4 900 XGL video card.


Quote
2, Do you use windows xp with default drivers? (if so, update as windows don't provide opengl support)


I am running Windows XP with the Nvidia latest drivers.

Quote
3, Do you use linux without native (nvidia,ati etc) drivers?


I am currently not using Linux as my OS.

Thanks

Zak

----------------------------------
Zak Nixon
Software Engineer
Davidson Technologies
-----------------------------------
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Caoimhin

Junior Devvie





« Reply #3 - Posted 2003-07-22 13:54:18 »

Zak,

I can't get your code fragment to compile.  I suggest taking a look at the gears demo and start with it as your framework.
8: Undefined index: online
File: /home/jgo/public_html/Themes/default/Display.template.php (main sub template - eval?)
Line: 161