mr_incredible
JGO n00b  Posts: 2
|
 |
«
Reply #90 on:
2008-04-03 11:21:36 » |
|
This example is terribly out of date. There is no longer a
GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas( new GLCapabilities() );
call.
|
|
|
|
|
cylab
JGO Kernel      Posts: 1909 Medals: 24
|
 |
«
Reply #91 on:
2008-04-16 16:10:02 » |
|
Here is a working example: 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| package org.yourorghere;
import com.sun.opengl.util.Animator; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCanvas; import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU;
public class SimpleJOGL implements GLEventListener {
public static void main(String[] args) { Frame frame = new Frame("Simple JOGL Application"); GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new SimpleJOGL()); frame.add(canvas); frame.setSize(640, 480); final Animator animator = new Animator(canvas); frame.addWindowListener(new WindowAdapter() {
@Override public void windowClosing(WindowEvent e) { new Thread(new Runnable() {
public void run() { animator.stop(); System.exit(0); } }).start(); } }); frame.setLocationRelativeTo(null); frame.setVisible(true); animator.start(); }
public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); System.err.println("INIT GL IS: " + gl.getClass().getName());
gl.setSwapInterval(1);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); gl.glShadeModel(GL.GL_SMOOTH); }
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL gl = drawable.getGL(); GLU glu = new GLU();
if (height <= 0) { height = 1; } final float h = (float) width / (float) height; gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(45.0f, h, 1.0, 20.0); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); }
public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity();
gl.glTranslatef(-1.5f, 0.0f, -6.0f);
gl.glBegin(GL.GL_TRIANGLES); gl.glColor3f(1.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(1.0f, -1.0f, 0.0f); gl.glEnd();
gl.glTranslatef(3.0f, 0.0f, 0.0f); gl.glBegin(GL.GL_QUADS); gl.glColor3f(0.5f, 0.5f, 1.0f); gl.glVertex3f(-1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, -1.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 0.0f); gl.glEnd();
gl.glFlush(); }
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } } |
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
Trussell
Jr. Member   Posts: 56
Game Developer
|
 |
«
Reply #92 on:
2008-04-26 17:36:54 » |
|
When I try the code above, I get the following error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jogl in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:189) at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:49) at com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeLibLoader.java:80) at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:103) at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:49) at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:111) at java.security.AccessController.doPrivileged(Native Method) at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109) at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.<clinit>(WindowsGLDrawableFactory.java:60) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106) at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:520) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:83) at joglscape.SimpleJOGL.main(SimpleJOGL.java:25)
|
I am a noob attempting to make a video game.
|
|
|
Games published by our own members! Go get 'em!
|
|
cylab
JGO Kernel      Posts: 1909 Medals: 24
|
 |
«
Reply #93 on:
2008-04-26 18:37:13 » |
|
You have to start your program with configured native libraries. This means you have to add 1
| -Djava.library.path=<path/to/jogl/natives/folder>:<path/to/gluegen-rt/natives/folder> |
to the command line starting your app. If you use an IDE add this to the JVM-ARGS parameter in your IDEs run configuration. If you use NetBeans, you can try our OpenGL Pack. If you haven't already, read the JOGL User's Guide. It also describes an alternative configuration option that involves modifying your systems CLASSPATH and PATH/LD_LIBRARY_PATH environment variables, which might be less cumbersome if you use the commandline instead of an IDE.
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
gorgonzola
JGO n00b  Posts: 2
|
 |
«
Reply #94 on:
2008-04-28 04:30:49 » |
|
I finally got it working, turned out while trying to install about 5000 times over and over I had left some old jogl.jar files in another of my classpath so I still got the unlinked-blabla-error. When I removed them everything worked ^_^
|
|
|
|
|
gorgonzola
JGO n00b  Posts: 2
|
 |
«
Reply #95 on:
2008-04-29 06:11:01 » |
|
Btw I think this should be included somewhere in this topic, maybe in the first post http://fivedots.coe.psu.ac.th/~ad/jg2/It's the best tutorial I have found by far after several hours of searching.
|
|
|
|
|
KeySabreur
JGO n00b  Posts: 1
|
 |
«
Reply #96 on:
2008-06-20 20:37:47 » |
|
Here is a working example: 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
| package org.yourorghere;
import com.sun.opengl.util.Animator; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCanvas; import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU;
public class SimpleJOGL implements GLEventListener {
public static void main(String[] args) { Frame frame = new Frame("Simple JOGL Application"); GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new SimpleJOGL()); frame.add(canvas); frame.setSize(640, 480); final Animator animator = new Animator(canvas); frame.addWindowListener(new WindowAdapter() {
@Override public void windowClosing(WindowEvent e) { new Thread(new Runnable() {
public void run() { animator.stop(); System.exit(0); } }).start(); } }); frame.setLocationRelativeTo(null); frame.setVisible(true); animator.start(); }
public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); System.err.println("INIT GL IS: " + gl.getClass().getName());
gl.setSwapInterval(1);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); gl.glShadeModel(GL.GL_SMOOTH); }
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL gl = drawable.getGL(); GLU glu = new GLU();
if (height <= 0) { height = 1; } final float h = (float) width / (float) height; gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(45.0f, h, 1.0, 20.0); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); }
public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity();
gl.glTranslatef(-1.5f, 0.0f, -6.0f);
gl.glBegin(GL.GL_TRIANGLES); gl.glColor3f(1.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(1.0f, -1.0f, 0.0f); gl.glEnd();
gl.glTranslatef(3.0f, 0.0f, 0.0f); gl.glBegin(GL.GL_QUADS); gl.glColor3f(0.5f, 0.5f, 1.0f); gl.glVertex3f(-1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, -1.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 0.0f); gl.glEnd();
gl.glFlush(); }
public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } } |
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$000(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106) at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:520) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:83) at SimpleJOGL.main(SimpleJOGL.java:25) Caused by: java.lang.ClassNotFoundException: com.sun.gluegen.runtime.DynamicLookupHelper at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 32 more What happened? What should I do?
|
|
|
|
|
cylab
JGO Kernel      Posts: 1909 Medals: 24
|
 |
«
Reply #97 on:
2008-06-21 19:25:37 » |
|
This usually happens if you either don't have the gluegen-rt.jar on your classpath or you have a conflicting jogl/gluegen installation somewhere in your system directories like jre/ext, C:\windows\system32 etc. Make sure you only have one installation of jogl/gluegen on your system in a dedicated (non-system) directory (e.g. "C:\development\jogl", "/home/<user>/development/jogl" or something like that) and either setup your environment variables accordingly or start your app with the right commanline options (see above)
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
ajith_kgs
JGO n00b  Posts: 3
|
 |
«
Reply #98 on:
2008-08-05 10:46:29 » |
|
Hi. I am a beginner in JOGL and I was trying out some tutorials I got from nehe.gamedev.net (for c / c++).. I hit a snag when I was doing the 3d shapes tutorial, the tutorial says, that we need to move the drawing point to the loc (-1.5, 0, -6.0), using glTranslatef() func. I tried the same but I am getting just a black screen. I tried the code without changing the drawing point, i.e leaving it at its original place (0, 0, 0), then I could see a very big pyramid rotating. Here is the code. I am using eclipse, with the latest JRE and JOGL library. Can somebody please tell me, what I am doing wrong.  Thanks in advance. 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| import javax.media.opengl.*; import com.sun.opengl.util.Animator; import javax.media.opengl.GLEventListener; import java.awt.*; import java.awt.event.*;
class SimpleEventListener implements GLEventListener{ float rt; Animator anim; public void init(GLAutoDrawable drawable){ GL gl = drawable.getGL(); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); rt=0.0f; anim= new Animator(drawable); anim.start(); } public void display(GLAutoDrawable drawable){ GL gl = drawable.getGL(); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ); gl.glLoadIdentity(); gl.glTranslatef(-1.5f, 0.0f, -6.0f); gl.glRotatef(rt, 0.0f, 1.0f, 0.0f); gl.glBegin(GL.GL_TRIANGLES); gl.glColor3f(1.0f,0.0f,0.0f); gl.glVertex3f( 0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f,1.0f,0.0f); gl.glVertex3f(-1.0f,-1.0f, 1.0f); gl.glColor3f(0.0f,0.0f,1.0f); gl.glVertex3f( 1.0f,-1.0f, 1.0f); gl.glColor3f(1.0f,0.0f,0.0f); gl.glVertex3f( 0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f,0.0f,1.0f); gl.glVertex3f( 1.0f,-1.0f, 1.0f); gl.glColor3f(0.0f,1.0f,0.0f); gl.glVertex3f( 1.0f,-1.0f, -1.0f); gl.glColor3f(1.0f,0.0f,0.0f); gl.glVertex3f( 0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f,1.0f,0.0f); gl.glVertex3f( 1.0f,-1.0f, -1.0f); gl.glColor3f(0.0f,0.0f,1.0f); gl.glVertex3f(-1.0f,-1.0f, -1.0f); gl.glColor3f(1.0f,0.0f,0.0f); gl.glVertex3f( 0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f,0.0f,1.0f); gl.glVertex3f(-1.0f,-1.0f,-1.0f); gl.glColor3f(0.0f,1.0f,0.0f); gl.glVertex3f(-1.0f,-1.0f, 1.0f); gl.glEnd(); rt+=0.2f; } public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h){} public void displayChanged(GLAutoDrawable drawable, boolean b1, boolean b2){} } public class SimpleTest {
public static void main(String[] args) { Frame frame= new Frame("SimpleTest"); GLCanvas canvas= new GLCanvas(); SimpleEventListener listener= new SimpleEventListener(); frame.setSize(640, 480); frame.add(canvas); frame.setVisible(true); canvas.addGLEventListener(listener); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); } } |
|
|
|
|
|
GKW
Sr. Member   Posts: 453
Revenge is mine!
|
 |
«
Reply #99 on:
2008-08-05 11:45:34 » |
|
You need to set up your projection matrix.
|
|
|
|
|
Games published by our own members! Go get 'em!
|
|
ajith_kgs
JGO n00b  Posts: 3
|
 |
«
Reply #100 on:
2008-08-05 11:49:39 » |
|
ok.. how am I supposed to do that?
|
|
|
|
|
cylab
JGO Kernel      Posts: 1909 Medals: 24
|
 |
«
Reply #101 on:
2008-08-05 12:27:56 » |
|
Take a look at the SimpleJOGL example some post above, and copy the reshape()-method to your SimpleEventListener class. Also the Animator should not be instantiated and started inside the init() callback. Chances are, that init() is called multiple times on e.g. window resize and you would instantiate and start multiple animators this way, which could lead to an application freeze. Again, take a look at the SimpleJOGL example.
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
ajith_kgs
JGO n00b  Posts: 3
|
 |
«
Reply #102 on:
2008-08-05 13:33:24 » |
|
yea, i tried it. it works ..  thank you..
|
|
|
|
|
nortino
JGO n00b  Posts: 2
|
 |
«
Reply #103 on:
2008-08-25 18:31:34 » |
|
Hi, I've read this thread and googled around, but I'm having a problem getting JOGl to run in an Eclipse project. I've followed the instructions here: http://www.geofx.com/html/OpenGL_Eclipse/OpenGL_Eclipse.htmlto make a simple Eclipse RCP application with a single View that implements GLEventListener, and basically the project builds OK, but when I run it I get the following exception: java.lang.NoClassDefFoundError: javax/media/opengl/GLEventListener Now, I have a directory called "C:\jogl-1.1.1-windows-i586" which is an unzip of the jogl-1.1.1-windows-i586.zip, and so contains the JOGl dlls and jars, and I have included the gluegen-rt.jar and jogl.jar from here in my Eclipse project. As I say, Eclipse is happy with this and the project builds fine, and it can 'see' javax/media/opengl/GLEventListener, but it fails at runtime. I have tried adding "C:\jogl-1.1.1-windows-i586" and the "C:\jogl-1.1.1-windows-i586\lib" subdirectory to my Path environment variable, but I get the same error. Any help would be appreciated.
|
|
|
|
|
nortino
JGO n00b  Posts: 2
|
 |
«
Reply #104 on:
2008-08-26 19:06:06 » |
|
Right, I've solved this now. For anyone with a similar issue, here is my understanding of the situation: To recap, I'm trying to get a minimal JOGL example working in an Eclipse RCP application. The application compiles fine, but craps out at runtime with "java.lang.NoClassDefFoundError: javax/media/opengl/GLEventListener". This seems like typical classpath fun and games, so I fart around and set my CLASSPATH environment variable (I'm on Win XP) to include the world and his wife, but of course it still doesn't work. I try putting all the JOGL crap in the "\jdk1.6.0_01\jre\lib\ext" directory. This not only doesn't solve the problem, but now it won't even build (Eclipse complains about Access Restriction on the JOGL stuff; great) - I know putting the JOGL stuff in here is naughty but I'm just trying to get it to work, so w/e. What I didn't realise is that Eclipse ignores the CLASSPATH variable, so messing around with that is a waste of time. My understanding was that if you included a JAR in the Project > Properties > Libraries > Add External Jars bit, then Eclipse would sort out the CLASSPATH stuff for you, and certainly it adds some stuff to its little .classpath file, but it doesn't work at runtime, so there you go. Anyway, I think this is some special wierdness of making an RCP application. I think you have to do Other Things to get the CLASSPATH sorted for external JARs in an Eclipse RCP application. Here's what I did: Start a clean RCP Plug-In project in Eclipse. Add a lib directory to it. Put the gluegen-rt.jar and jogl.jar in there. Right-click on them in Eclipse and do 'Add to Build Path'. Right-click your MANIFEST.MF file and do 'Open With' > 'Plug-in Manifest Editor'. In the Manifest Editor select the Runtime tab. On there, under the Classpath bit click 'Add...', and select your lib/gluegen-rt.jar and lib/jogl.jar. That's it really. This is basically following the steps here: http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/msg06980.htmlTo see some JOGL stuff, add a View and if you use the code from here it should work: http://www.geofx.com/html/OpenGL_Eclipse/OpenGL_Eclipse.htmlHope this is helpful to someone.
|
|
|
|
|
EpicNerd
JGO n00b  Posts: 4
|
 |
«
Reply #105 on:
2009-06-11 12:02:33 » |
|
I'm getting an error similar to the one listed a couple of posts above. I've double-checked and there is only one instance of the gluegen-rt.jar file on my system and it is in the same directory as my jogl.jar file (which Java is finding correctly).
Here is the command I'm running and here is the error: [CODE] c:\JOGL\Examples>java -Djava.library.path=c:\jogl\native -classpath c:\jogl\jogl.jar;. SimpleJOGL
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/gluegen/runtime/DynamicLookupHelper at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106) at javax.media.opengl.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:520) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:131) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:90) at javax.media.opengl.GLCanvas.<init>(GLCanvas.java:83) at SimpleJOGL.main(SimpleJogl.java:23) Caused by: java.lang.ClassNotFoundException: com.sun.gluegen.runtime.DynamicLookupHelper at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 32 more [/CODE]
|
|
|
|
|
bienator
JGO Ninja    Posts: 632 Medals: 1
OutOfCoffeeException
|
 |
«
Reply #106 on:
2009-06-11 12:08:40 » |
|
you forgot to add gluegen-rt.jar to the classpath. c:\JOGL\Examples>java -Djava.library.path=c:\jogl\native -classpath c:\jogl\jogl.jar;c:\jogl\gluegen-rt.jar;. SimpleJOGL
|
|
|
|
EpicNerd
JGO n00b  Posts: 4
|
 |
«
Reply #107 on:
2009-06-11 12:12:00 » |
|
That would be it. Thanks! Isn't there a better way to set that somehow? At least now I can play around with stuff. Thanks again.
|
|
|
|
|
cylab
JGO Kernel      Posts: 1909 Medals: 24
|
 |
«
Reply #108 on:
2009-06-11 17:03:45 » |
|
That would be it. Thanks! Isn't there a better way to set that somehow? At least now I can play around with stuff. Thanks again.
You could add the jars to the CLASSPATH environment variable and the directories with the native libraries to the PATH. Oh and also read the "Jogl Users Guide" ;-)
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
falcon
JGO n00b  Posts: 4
|
 |
«
Reply #109 on:
2009-08-15 16:14:54 » |
|
It seems there are some changes in the API. I updated the 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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124
| import com.sun.opengl.util.Animator; import java.awt.Frame; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.*; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU; import javax.media.opengl.awt.GLCanvas;
public class SimpleJOGL implements GLEventListener {
public static void main(String[] args) { Frame frame = new Frame("Simple JOGL Application"); GLCanvas canvas = new GLCanvas();
canvas.addGLEventListener(new SimpleJOGL()); frame.add(canvas); frame.setSize(640, 480); final Animator animator = new Animator(canvas); frame.addWindowListener(new WindowAdapter() {
@Override public void windowClosing(WindowEvent e) { new Thread(new Runnable() {
public void run() { animator.stop(); System.exit(0); } }).start(); } }); frame.setLocationRelativeTo(null); frame.setVisible(true); animator.start(); }
public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); System.err.println("INIT GL IS: " + gl.getClass().getName());
gl.setSwapInterval(1);
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); gl.glShadeModel(GL2.GL_SMOOTH); }
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { GL2 gl = drawable.getGL().getGL2(); GLU glu = new GLU();
if (height <= 0) { height = 1; } final float h = (float) width / (float) height; gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(45.0f, h, 1.0, 20.0); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glLoadIdentity(); }
public void display(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2();
gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity();
gl.glTranslatef(-1.5f, 0.0f, -6.0f);
gl.glBegin(GL2.GL_TRIANGLES); gl.glColor3f(1.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 1.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(1.0f, -1.0f, 0.0f); gl.glEnd();
gl.glTranslatef(3.0f, 0.0f, 0.0f); gl.glBegin(GL2.GL_QUADS); gl.glColor3f(0.5f, 0.5f, 1.0f); gl.glVertex3f(-1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, 1.0f, 0.0f); gl.glVertex3f(1.0f, -1.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 0.0f); gl.glEnd();
gl.glFlush(); }
public void dispose(GLAutoDrawable drawable){} public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) { } } |
|
|
|
|
|
bienator
JGO Ninja    Posts: 632 Medals: 1
OutOfCoffeeException
|
 |
«
Reply #110 on:
2009-08-15 16:44:00 » |
|
(the whole thread is deprecated regarding JOGL2, its an introduction to JOGL1. Maybe a moderator should detach the thread from being the first in this forum)
|
|
|
|
Justmaker
JGO n00b  Posts: 2
|
 |
«
Reply #111 on:
2009-12-03 11:41:30 » |
|
I have a problem: I can't find the jogl.jar file! I (finally) suceeded in building Jogl, and in the jogl\build folder i have 3 other folders: jogl, nativewindow, newt. In the jogl folder, I have a whole list of jogl.XXX.jar files but never the simple jogl.jar file... Because of this, I cannot run the simple System.loadLibrary("jogl"); command...
Any advice?
|
|
|
|
|
Xerxes
JGO n00b  Posts: 1
|
 |
«
Reply #112 on:
2009-12-27 14:43:48 » |
|
Im sorry but i am horribly confused about creating and binding a context to GL! What exactly is the recommended Window ToolKit? In the FAQ you can read, awt and swing are bad but i cant get the native Window toolkit running. http://kenai.com/projects/jogl/forums/forum/topics/1691-How-to-create-a-native-window- <- i found this here where you can see how to create a native window. But i have no idea how to get a GLDrawable out of the window in order to add it to an Animator. If this question doesnt belong here please forgive me! Since this is my problem with the "getting started" part.
|
|
|
|
|
gingerfish
JGO n00b  Posts: 2
|
 |
«
Reply #113 on:
2010-01-15 03:17:41 » |
|
hey people, i wanna use new jogl package (i mean javax.media.opengl....), but i get errors  where i can download the latest release?? thanks 
|
|
|
|
|
rhdxmr
JGO n00b  Posts: 12
|
 |
«
Reply #114 on:
2010-01-19 10:54:12 » |
|
|
|
|
|
|
davips
JGO n00b  Posts: 2
|
 |
«
Reply #115 on:
2010-05-01 14:41:53 » |
|
Hello  , I'm developing the applet http://analisegrafica.net/applet.html. Some people report Java can't find the Main class, but it works on my Windows and Linux environments. I checked browser/Java/SO versions and all was equal to mine. What's wrong? Should I use JOGL 2? Is there a specific Topic about? Is there a Netbeans plugin for JOGL 2? Thanks 
|
|
|
|
|
gouessej
JGO Kernel      Posts: 3433 Medals: 26
TUER
|
 |
«
Reply #116 on:
2011-06-30 18:07:23 » |
|
|
Julien Gouesse
|
|
|
Eli Delventhal
« League of Dukes » JGO Kernel      Posts: 3478 Medals: 39
Game Engineer
|
 |
«
Reply #117 on:
2011-06-30 19:01:04 » |
|
hey people, i wanna use new jogl package (i mean javax.media.opengl....), but i get errors  where i can download the latest release?? thanks  In the future instead of resurrecting an old thread, just make a new topic with your question. 
|
See my work:OTC Software<br /> Currently Working On:Secret project... I edit JGO in production, because I simply don't waste time writing bugs
|
|
|
cylab
JGO Kernel      Posts: 1909 Medals: 24
|
 |
«
Reply #118 on:
2011-07-01 05:07:39 » |
|
(...)
In the future instead of resurrecting an old thread (...) LOL
|
Mathias - I Know What [you] Did Last Summer!
|
|
|
lhkbob
JGO Neuromancer     Posts: 1113 Medals: 30
|
 |
«
Reply #119 on:
2011-07-01 11:37:32 » |
|
hey people, i wanna use new jogl package (i mean javax.media.opengl....), but i get errors  where i can download the latest release?? thanks  In the future instead of resurrecting an old thread, just make a new topic with your question.  What happened to going green? We need to recycle, man!
|
|
|
|
|