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 33983 times)
Re: using opengl from eclipse
Reply #15 - Apr 15th, 2006, 5:35am
 
hello for mac osx I put those two files:
libjogl_cg.jnilib
libjogl.jnilib

in library/java/extensions
folder

and added jogl.jar and opengl.jar as external jars in my project and then

when I say size(500,500,OPENGL)

it works for me.

hth
Re: using opengl from eclipse
Reply #16 - Apr 24th, 2006, 6:45pm
 
ilteris wrote on Apr 15th, 2006, 5:35am:
hello for mac osx I put those two files:
libjogl_cg.jnilib
libjogl.jnilib

in library/java/extensions
folder

and added jogl.jar and opengl.jar as external jars in my project and then

when I say size(500,500,OPENGL)

it works for me.


Is that the System/Library/Java folder or the (Hard Disk)/Library/Java folder.

I was really hoping for a solution as simple as the one you proposed!
Re: using opengl from eclipse
Reply #17 - Apr 25th, 2006, 7:51pm
 
DO NOT put the jogl files in /extensions, or add them to your CLASSPATH on windows, unless you're prepared to replace them every time they're updated in a processing release. this will cause headaches like this one:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Contribution_Physical;action=display;num=1144940532

when running the app in eclipse you need to add something like:
-Djava.library.path=src/processing/opengl/library
to the "run" arguments.
Re: using opengl from eclipse
Reply #18 - Apr 25th, 2006, 10:10pm
 
Where are the "run" arguments?

4dplane
Re: using opengl from eclipse
Reply #19 - Jul 25th, 2006, 1:17am
 
thanks to this thread, i've got opengl rendering in a processing project in eclipse now using the technique of sending the path to the dll's in the arguments.

there is just one thing i'm a little concerned about... when i close the applet i was running out of eclipse, i get this error: javax.media.opengl.GLException: Unable to delete OpenGL context

is this a serious problem where resources in the java vm aren't going to be freed up properly after testing many times? is there a simple solution? thanks.

-aaron
Re: using opengl from eclipse
Reply #20 - Mar 15th, 2007, 1:39pm
 
I think I've figured out the best way to set up opengl in eclipse.

For simplicity's sake, I'll use "C:\Jogl" as the install directory. this can be any directory on your harddrive, so it should work for OSX or linux (i actually used my workspace folder to keep everything together)

1) copy jogl*.jar (all the jogl files, including the native ones) into C:\Jogl
2) create a folder inside the jogl folder called jogl-native
3) enter that folder (C:\Jogl\jogl-native)
4) using winzip or another zip extractor, unzip the native libraries into the folder (should now have some .dll, .jnilipm and .so files in the folder)
5) open eclipse if it's not already open
6) Menu -> Window -> Preferences
7) type "user" in the prefernce filter
8) click the "new" button to create a new user library.
9) Name it "Jogl"
10) select the newly created jogl library and click "Add Jars..."
11) browse to where you installed Jogl ("C:\Jogl" in our example) and select "jogl.jar"
12) expand the jar file's options and select "Native Library Location"
13) click edit
14) click external folder
15) browse to the folder where you extracted all the native libraries ("C:\Jogl\jogl-native" in our example) and select this folder
16) close the preferences
17) add a library to your project (right click on project name in eclipse -> build path-> add library)
18) select User Library
19) click next
20) select the "Jogl" library (check the checkbox next to it)
21) close out and you're done!

now you don't have to dirty up your java installation and it's fairly painless to update with new releases of Jogl
Re: using opengl from eclipse
Reply #21 - Mar 20th, 2007, 4:03am
 
ok ... I must be dumb, because I can not figure out how to run  an OpenGL sketch in Eclipse. It seems to me that I have tried everything.

Different versions of Java, different versions of jogl. Nothing works, always get the same thing. The OpenGl sketches run, but they freeze randomly (using 100% of the CPU power).

The same sketches run fine in the Processing PDE, on my Windows laptop. And I'm even able to make them run in Eclipse on a Mac G4 Laptop.

Doesn't make any sense to me.
Re: using opengl from eclipse
Reply #22 - Mar 20th, 2007, 2:46pm
 
something is wrong with my Dell laptop (with Mobility Radeon X600 128Mo of dedicated RAM) and OpenGL .
I have been able to run the same application (with the same config. java, lib, etc) on a Windows workstation.

On my laptop it seems that the application freeze (randomly) when the Applet has the focus and the mouse is over it (and again it only happens when using Eclipse).

Does anyone has experienced something like that ?
Re: using opengl from eclipse
Reply #23 - Mar 20th, 2007, 4:26pm
 
I finally got it.
I had to update my ATI drivers. But the thing is that I had the latest version of the Video drivers available from the Dell website. And if you go to the ATI website, Dell users can not install the drivers made directly from ATI (disclaimer saying that they are not compatible). I still have tried to install them, but as the disclaimer says, it didn't work.

But I found that amazing tool - ModTool v4.
http://www.driverheaven.net/modtool/

So far it works great for me.
Now I'm able to run OpenGL sketches from Eclipse.

[as a friend pointed out... "interesting, but its still curious why it was working in processing?"]
Re: using opengl from eclipse
Reply #24 - Jul 14th, 2008, 12:49am
 
On osx, I got OpenGL working in Eclipse with

-Djava.library.path=/Applications/processing/libraries/opengl/library


in Eclipse -> Run -> Run Configurations -> Arguments -> VM Arguments

for every new version of Processing, I put the 'Processing xxx' folder in my Applications folder and then rename the version I'm using to simply 'processing'.  This ensures the above path remains valid with every upgrade.

Also, make sure you import opengl.jar and jogl.jar into the project:

select your project in the Package explorer
File -> Properties -> Libraries -> Add External JARs
then navigate to (in my case) /Applications/processing/libraries/opengl/library to find them.


I can the use the (almost) regular Processing code:

Code:

import processing.core.*;
import processing.opengl.*;

public class myproject extends PApplet {

public void setup() {

size(800, 800, OPENGL);

}

}

Re: using opengl from eclipse
Reply #25 - Sep 15th, 2008, 9:15pm
 
followup on Darth Android's post for newer versions of processing (0145) that are using jogl 1.1.1:

in addition to copying the jogl jars to your user library folder, you'll also need to copy the gluegen jars (to the same folder as the jogl jars, c:\jogl in Darth's example).  that includes gluegen-rt.jar and the gluegen-rt-native jars for each of the supported platforms (6 others, 2 for linux, 2 for osx, two for win).

you don't need to extract the natives into your jogl-native folder, just copying the jars is enough.

also worth posting here, for googliciousness:

http://rednoise.org/EclipseP5Exporter

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=os_core_pde;action=display;num=1182196035

however, user libraries aren't quite working (on osx) with EclipseP5Exporter just yet.  reportedly almost there, tho.

http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1221248717
Re: using opengl from eclipse
Reply #26 - Sep 24th, 2008, 2:43am
 
Hey thanks a lot liminal !! That solution worked without any problem ! Smiley

Re: using opengl from eclipse
Reply #27 - 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.
Re: using opengl from eclipse
Reply #28 - Oct 25th, 2008, 4:45pm
 
Hi.
I had this working doing what sgsrules said, but now, all of a sudden my exports dont work anymore! I tried exporting with eclipse's "runnable jar", and also with eclipsep5exporter, and none works. It can run fine inside eclipse, its just exporting that doesn't work!
running my application java runnable stub i throws the following error:

java.lang.RuntimeException: java.lang.ClassCastException: java.nio.DirectByteBuffer
at processing.opengl.PGraphicsOpenGL.requestDisplay(PGraphicsOpenGL.java:180)
at processing.core.PApplet.run(PApplet.java:1542)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.ClassCastException: java.nio.DirectByteBuffer
at com.sun.opengl.impl.macosx.MacOSXOnscreenGLDrawable.lockSurface(MacOSXOnscreenGL
Drawable.java:177)
at com.sun.opengl.impl.macosx.MacOSXOnscreenGLContext.makeCurrentImpl(MacOSXOnscree
nGLContext.java:57)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:127)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java
:298)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
69)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Attempt to make the same context current twice on thread Thread[AWT-EventQueue-0,6,main]
at com.sun.opengl.impl.GLContextLock.lock(GLContextLock.java:83)
at com.sun.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:124)
at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:182)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:258)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:276)
at sun.awt.RepaintArea.paint(RepaintArea.java:241)
at apple.awt.ComponentModel.handleEvent(ComponentModel.java:268)
at java.awt.Component.dispatchEventImpl(Component.java:4144)
at java.awt.Component.dispatchEvent(Component.java:3903)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:2
69)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190
)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

i googled for the error and saw that more people had it in other forums but no one actually presented an answer. maybe some one here knows what is causing this and how to fix it?

thanks

Rui
Re: using opengl from eclipse
Reply #29 - Nov 4th, 2008, 1:18am
 
Hello

I've spent all evening looking at the processing forum and I'd like to clarify a couple of points:

1- moving sketches into eclipse means you need to modify your code.  But is there a definitive resource which helps with this?
It seems to be specific to versioning (which we know is a nightmare with Apple's java support).

2- there are a load of opengl examples which come with 0152 but as from point 1 they aren't going to just run in eclipse. Is there a modified set of examples which work with eclipse for the learning visualists among us?

3- I want to get heavily into high speed, midi/osc triggered, smoothed, opengl powered 3d animation; processing seems from the text book to be able to do it, but the book doesn't go into openGL in any detail nor processing with eclipse.  Is it recommended I look at an openGL resource and learn how to convert the processing code to eclipse given that I want to use opengl through processing, as there doesn't appear to be an eclipse processing opengl reference available?

s.
Pages: 1 2 3