We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › using opengl from eclipse
Pages: 1 2 3 
using opengl from eclipse (Read 33984 times)
Re: using opengl from eclipse
Reply #30 - Dec 24th, 2008, 5:09pm
 
sgsrules wrote on Oct 13th, 2008, 2:22am:
The easiest way to get eclipse working with opengl is the following:

1) Import core.jar opengl.jar and jogl.jar, then add them to the build path.
2) Extract all the native jogl jars in the opengl directory to a separate directory.
3) Right click on jogl.jar in eclipse and goto properties under native libraries click on external folder and select the folder you extracted all the native opengl stuff to.


this worked for me.

-0.
Re: using opengl from eclipse
Reply #31 - Dec 31st, 2008, 6:59am
 
Following on from the sgrules post, I'm on a mac using processing 1.0.1. And I had to also add the gluegen-rt.jar to the project build path (and setup it's native libraries) in order to get the project to run.

Just in case anyone else is hitting the same wall.

Happy New Year everyone.
Re: using opengl from eclipse
Reply #32 - Jan 30th, 2009, 5:24pm
 
Just like polymonkey, but on Windows XP - I just had to specify gluegen-rt.jar native libraries (that is gluegen-rt.dll, even thou there in the same directory). jogl.jar found it's dll's without any help.

All the best!
Re: using opengl from eclipse
Reply #33 - Sep 22nd, 2009, 3:17am
 
Hey,
I have the same problem.
I working with eclipse Version: 3.4.1 on Windows XP.


xception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
     at java.lang.ClassLoader.loadLibrary(Unknown Source)
     at java.lang.Runtime.loadLibrary0(Unknown Source)
     at java.lang.System.loadLibrary(Unknown Source)
     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.ja
va: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>(WindowsGLDrawableF
actory.java:60)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Unknown Source)
     at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106)
     at processing.opengl.PGraphicsOpenGL.allocate(PGraphicsOpenGL.java:172)
     at processing.core.PGraphics3D.setSize(PGraphics3D.java:316)
     at processing.core.PApplet.makeGraphics(PApplet.java:1164)
     at processing.core.PApplet.size(PApplet.java:998)
     at processing.core.PApplet.size(PApplet.java:958)
     at TuioDemo.TuioDemo.setup(TuioDemo.java:52)
     at processing.core.PApplet.handleDraw(PApplet.java:1402)
     at processing.core.PApplet.run(PApplet.java:1327)
     at java.lang.Thread.run(Unknown Source)


I add already the opengl.jar etc. packages.
my be I forgot to include something?
can anybody help?
Thanks Max
Re: using opengl from eclipse
Reply #34 - Sep 22nd, 2009, 4:33am
 
You have to set the native library location of the jogle.jar to the folder where to find the jogl.jar.

Java Build Path -> Libraries -> jogl.jar -> native library location
Re: using opengl from eclipse
Reply #35 - Feb 6th, 2010, 4:15pm
 
After parsing through all these messages, I was able to piece together a solution to getting OpenGL running in a PApplet, in Eclipse 3.5.1, on Windows.  So that others don't have to go through what I went through to figure it out, I'll tell you exactly what I did:

1. Create a new Java project
2. Right click on the project root and add a new folder named "lib".
3. Right click on your new folder and create a new folder inside of it called "opengl-natives".
4. Right-click on your "lib" folder and choose "Import".
5. Browse to your "Processing\lib" folder and import the following file:

  - core.jar

6. Right-click on your "lib" folder and choose "Import".
7. Browse to your "Processing\libraries\opengl\library" folder and import the following files:

  - gluegen-rt.jar
  - jogl.jar
  - opengl.jar

8. Right-click on your "opengl-natives" (which is inside your "lib" folder) and choose "Import".
9. Browse to your "Processing\libraries\opengl\library" folder and import *ALL* files, *EXCEPT* the following:

  - gluegen-rt.jar
  - jogl.jar
  - opengl.jar

10. In your project's "lib" folder, right-click "gluegen-rt.jar" and choose "Properties".
11. Under "Native Library", click "Workspace" and browse to "YourProjectName/lib/opengl-natives" and click "OK".
12. In your project's "lib" folder, right-click "jogl.jar" and choose "Properties".
13. Under "Native Library", click "Workspace" and browse to "YourProjectName/lib/opengl-natives" and click "OK".
14. Run this as your main class:

import processing.core.*;
import processing.opengl.*;
import javax.media.opengl.GL;

@SuppressWarnings("serial")
public class MyApp extends PApplet
{

    public void setup()
    {

         size(800, 600, OPENGL);

    }

}





The key things to note here are that your core JAR files are *not* in the same folder as their respective natives, and that, and for Windows, the DLL files absolutely must be in with these natives.
Re: using opengl from eclipse
Reply #36 - Feb 7th, 2010, 6:07am
 
Using the proclipsing plugin for eclipse make it a lot easier to start sketches including library import and application export.

http://code.google.com/p/proclipsing/
Re: using opengl from eclipse
Reply #37 - Feb 12th, 2010, 4:49am
 
try changing the line:

 translate(width / 2, height / 2, 100);

to:

 translate((width+1) / 2, (height+1) / 2, 100);
Re: using opengl from eclipse
Reply #38 - Apr 9th, 2010, 5:00pm
 
The instructions from letsgooutside were super helpful and I finally managed to get PGraphicsGL working in Eclipse. I had to find a copy of 1.0.3 in order to create the applet instance within my own JFrame, but once that was resolved it runs fine.

Now that I have created this nice template project for future use, I want to make sure I can export everything properly. However, when I simply attempt to export a fat jar of the project and run it at the command line, I get an UnsatisfiedLinkError:

Code:

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: no jogl in java.library.path
       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709)
       at java.lang.Runtime.loadLibrary0(Runtime.java:823)
       at java.lang.System.loadLibrary(System.java:1030)
       at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoad
er.java:189)
       at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:4
9)
       at com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeL
ibLoader.java:80)
       at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:
103)
       at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:4
9)
       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>(Windows
GLDrawableFactory.java:60)
       at java.lang.Class.forName0(Native Method)
       at java.lang.Class.forName(Class.java:169)
       at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.jav
a:106)
       at processing.opengl.PGraphicsOpenGL.allocate(PGraphicsOpenGL.java:172)
       at processing.core.PGraphics3D.setSize(PGraphics3D.java:316)
       at processing.core.PApplet.makeGraphics(PApplet.java:1165)
       at processing.core.PApplet.size(PApplet.java:999)
       at processing.core.PApplet.size(PApplet.java:959)
       at com.datadreamer.opengl.OpenGLCanvas.setup(OpenGLCanvas.java:21)
       at processing.core.PApplet.handleDraw(PApplet.java:1400)
       at processing.core.PApplet.run(PApplet.java:1328)
       at java.lang.Thread.run(Thread.java:619)


TLDR: Has anyone got a good solution for exporting Processing based OpenGL projects from Eclipse?
Re: using opengl from eclipse
Reply #39 - Apr 9th, 2010, 5:09pm
 
Silly me... a little more research and I found that I just needed to add an argument for the VM in order to find the classpath:

java -Djava.library.path=opengl -jar OpenGLTemplate.jar

I will ultimately have a batch file automatically launching this application, so this method is a fine solution for the time being.
Pages: 1 2 3