Jump to content
  • Advertisement
Sign in to follow this  
Shadowwoelf

Jogl tutorial

This topic is 2482 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

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

[color=#000000][font=sans-serif]

I downloaded: 32-bit Windows: [/font]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=#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=#000000]Then I linked it to my java project

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

[color="#000000"]package jogl;
[color="#000000"]import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
[color="#000000"]import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
[color="#000000"]import com.jogamp.graph.curve.opengl.Renderer;
[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="#000000"] // The canvas is the widget that's drawn in the JFrame
GLCanvas glcanvas = new GLCanvas(capabilities);
[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="#000000"] // END ERROR
[color="#000000"] glcanvas.setSize(300, 300);
[color="#000000"] JFrame frame = new JFrame("Hello World");
frame.getContentPane().add(glcanvas);
[color="#000000"] // shutdown the program on windows close event
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
});
[color="#000000"] frame.setSize(frame.getContentPane().getPreferredSize());
frame.setVisible(true);
}
}

[color=#000000]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.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!