Jump to content

  • Log In with Google      Sign In   
  • Create Account


Jogl tutorial


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Shadowwoelf   Members   -  Reputation: 136

Like
0Likes
Like

Posted 28 February 2012 - 02:05 PM

I need some help finding a good tutorial on JOGL in eclipse. All the ones I found have caused errors, which I couldn't resolve.

Here is what I have done:

I went to the follow wiki and followed the instructions

http://jogamp.org/wiki/index.php/Jogl_Tutorial#JogAmp.27s_Wiki

I downloaded: 32-bit Windows: jogamp-windows-i586.7z
Then in eclipse I extracted all the jars from the jar file. Including everything in the subfolder named Atomic.
With the jar files I made a custom user library. Only thing i didn't do was input each source attachment and native library location.
Then I linked it to my java project

After that I tried running the following code :

package jogl;[/color]
[color="#000000"]import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;[/color]
[color="#000000"]import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;[/color]
[color="#000000"]import com.jogamp.graph.curve.opengl.Renderer;[/color]
[color="#000000"]public class HelloWorld {
public static void main(String[] args) {
  // setup OpenGL Version 2
  GLProfile profile = GLProfile.get(GLProfile.GL2);
  GLCapabilities capabilities = new GLCapabilities(profile);[/color]
[color="#000000"]  // The canvas is the widget that's drawn in the JFrame
  GLCanvas glcanvas = new GLCanvas(capabilities);[/color]
[color="#000000"]  // ERROR: Cannont instantion Renderer, addGLEventListener is The method
  // addGLEventListener(GLEventListener) in the type GLCanvas is not
  // applicable for the arguments (Renderer)
  glcanvas.addGLEventListener(new Renderer());[/color]
[color="#000000"]  // END ERROR[/color]
[color="#000000"]  glcanvas.setSize(300, 300);[/color]
[color="#000000"]  JFrame frame = new JFrame("Hello World");
  frame.getContentPane().add(glcanvas);[/color]
[color="#000000"]  // shutdown the program on windows close event
  frame.addWindowListener(new WindowAdapter() {
   public void windowClosing(WindowEvent ev) {
    System.exit(0);
   }
  });[/color]
[color="#000000"]  frame.setSize(frame.getContentPane().getPreferredSize());
  frame.setVisible(true);
}
}

Which gave me an error on the follow "Cannot instantion Renderer, addGLEventListener is The method addGLEventListener(GLEventListener) in the type GLCanvas is not applicable for the arguments (Renderer).

Any help would be appreciated. I feel like once I get this set up, I would be on my way.

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS