Sign in to follow this  

Jogl tutorial

This topic is 2148 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

[url="http://jogamp.org/wiki/index.php/Jogl_Tutorial#JogAmp.27s_Wiki"]http://jogamp.org/wiki/index.php/Jogl_Tutorial#JogAmp.27s_Wiki[/url]

[color=#000000][font=sans-serif][size=3]I downloaded: 32-bit Windows: [/size][/font][/color]jogamp-windows-i586.7z
[color=#000000]Then in eclipse I extracted all the jars from the jar file. Including everything in the subfolder named Atomic.[/color]
[color=#000000]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.[/color]
[color=#000000]Then I linked it to my java project[/color]

[color="#000000"]After that I tried running the following code :[/color]

[color="#000000"][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);
}
}[/code][/color]
[color=#000000]Which gave me an error on the follow "[/color]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.

Share this post


Link to post
Share on other sites

This topic is 2148 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this