Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JOGL Development / Re: I have problem GLJPanel getContext() on: 2009-02-05 17:15:59
I work  on the project that I does not make  , I must draw swing button on canvas so I change GLCanvas with GLJPanel .    as   the Result of this I have this error.
2  Java Game APIs & Engines / JOGL Development / I have problem GLJPanel getContext() on: 2009-02-05 10:31:32

I use  GLJPanel and  I write below code but I have below error  But I do not take any error GLcanvas. I think  I take error   when    I call getContext()  method.  How can I  solve this problem

                Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
   at javax.media.opengl.GLJPanel.getContext(GLJPanel.java:787)
   at FisrtJoglPackage.SceneRenderer.<init>(JOGLDemo5.java:221)
                     ..............
                   ..............



public class JOGLDemo5 extends JFrame implements ChangeListener
{
   final static int WIDTH = 100;
   final static int HEIGHT = 100;

   final static int FPS = 30;
   private SceneRenderer sr;
   FPSAnimator animator;

   public JOGLDemo5 ()
   {
      
      
      
      super ("JOGLDemo #5");

     
      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      GLCapabilities caps=new GLCapabilities();
      caps.setAlphaBits(0);
       sr = new SceneRenderer (caps);
     
      final Animator animator = new Animator(sr);
      sr.setPreferredSize (new Dimension (WIDTH, HEIGHT));
   
     this.add(sr);
       
     
      initGui();
           
      pack ();
      setVisible (true);
      animator.start();
   
   }



  public static void main (String [] args)
   {
      Runnable r = new Runnable ()
                   {
                       public void run ()
                       {
                          new JOGLDemo5 ();
                       
                       }
                   };
      EventQueue.invokeLater (r);
   }




class SceneRenderer extends GLJPanel implements GLEventListener,MouseListener,MouseMotionListener
{
   public SceneRenderer ( GLCapabilities caps)
   {
      
      
      super(caps);
      GLContext context=  this.getContext();
       context.getGL();
       addGLEventListener (this);
     
   }

   public void init (GLAutoDrawable drawable)
   {
      
      
      
      
      GL gl = drawable.getGL ();
      glc=drawable.getGL();
      gl.glEnable (GL.GL_DEPTH_TEST);
      gl.glShadeModel(GL.GL_SMOOTH);
      gl.glClearColor(0, 0, 0, 0);
   
     
   }

public void display (GLAutoDrawable drawable)
   {
     
    
      GL gl = drawable.getGL ();

        //Draw Something

}

public void reshape (GLAutoDrawable drawable, int x, int y, int width,
                        int height)
   {


}
3  Java Game APIs & Engines / JOGL Development / Re: Java2D/JOGL Interoperability Demo on: 2009-02-02 13:17:57
How can I find these  samples ' s  jogl source code
4  Java Game APIs & Engines / JOGL Development / Re: How can I draw navigator button on glcanvas on: 2009-02-02 11:02:26
Thanks I use GLJPANEL and I can add button on gljpanel. But I have layout problem because I resize the frame Mybutton keep its position but I want  my button  to relocation like google earth
5  Java Game APIs & Engines / JOGL Development / How can I draw navigator button on glcanvas on: 2009-02-01 19:51:18
hi, I want to make navigator button like upright corner in google earth program. I use java jogl. How can I do this.
Pages: [1]
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (84 views)
2013-05-17 21:29:12

alaslipknot (92 views)
2013-05-16 21:24:48

gouessej (124 views)
2013-05-16 00:53:38

gouessej (117 views)
2013-05-16 00:17:58

theagentd (127 views)
2013-05-15 15:01:13

theagentd (114 views)
2013-05-15 15:00:54

StreetDoggy (158 views)
2013-05-14 15:56:26

kutucuk (180 views)
2013-05-12 17:10:36

kutucuk (180 views)
2013-05-12 15:36:09

UnluckyDevil (187 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.093 seconds with 21 queries.