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 & HelpOpenGL and 3D Libraries › create an application with openGL
Pages: 1 2 
create an application with openGL? (Read 5308 times)
create an application with openGL?
Apr 29th, 2005, 1:16am
 
Hi

I need some help;

I need to create pc and mac applications from openGL processing sketches;

there are lots of threads on creating application in the alpha forum;

questions:

1) will an application with openGL work?
2) can someone kindly point me to the best method for creating both apps? I remembering following a set of instructions last year and failing miserably. So, any forum thread link is welcome.
Re: create an application with openGL?
Reply #1 - Apr 29th, 2005, 12:39pm
 
I second that, tried to do the same this week and failed miserable as well following instructions from the alpha forum.
Re: create an application with openGL?
Reply #2 - Apr 29th, 2005, 4:11pm
 
i just tried it using a similar method, it would appear that it only works in "present" mode (which is perhaps better anyway?) but i got the following to work:

1) i used the "CustomLetter" example, and added the following piece of code to the end of it:

static public void main(String args[]) {
 PApplet.main(new String[] { "--present", "--display=1", "CustomLetter" });
}

this will initiate the sketch in present mode, using the first display (p5 now has multi-display support, tho incomplete). for another sketch, change "CustomLetter" to whatever your sketch is named

2) from the command line, i went to the applet folder and started it with:
java -cp CustomLetter.jar CustomLetter
and it started up fine.

so you could put this into a .bat file so that it'd be double-clickable. on the mac you can make a similar file that's titled "something.command" which is essentially a double-clickable shell script. there's also the stuff about putting the class name into a MANIFEST file and all that, which should still work.

the holdup on export-to-application is that it's easy to implement but hell to test.. i'm a little wary of putting it in there without having time to test it a lot, for fear of mutiny here on the board, but who knows.
Re: create an application with openGL?
Reply #3 - May 7th, 2005, 5:21pm
 
ok; what can be wrong:

name of my sketch: gl_time

1) added to the code
Code:

static public void main(String args[]) {
PApplet.main(new String[] { "--present", "--display=1", "gl_time" });
}


2) command line, at the right folder:

java -cp gl_time.jar gl_time

and I get:

Usage: PApplet <appletname>
For additional options, see the javadoc for PApplet


...and nothing happens

any ideas?


thanks!
Re: create an application with openGL?
Reply #4 - May 7th, 2005, 6:04pm
 
hmmm...
it worked with other test files...

I need to investigate why it's not working with my project...

Re: create an application with openGL?
Reply #5 - May 7th, 2005, 7:38pm
 
update:

after a windows restart, it worked. (damn windows logic).

by the way, it worked great on both windows and mac.

My only advice is to add a keypressed with

if (key=='q') { System.exit(0); }

otherwise the app won't quit and the process will have to be killed

Re: create an application with openGL?
Reply #6 - May 24th, 2005, 5:24pm
 
Is there a display mode that will just create a pop
up window, rather than taking over the entire screen?
Thanks

Re: create an application with openGL?
Reply #7 - May 24th, 2005, 8:15pm
 
There is also something funny going on with
this approach. Specifically, I took my .jar
file (created via exporting after adding the
appropriate source lines mentioned above) and
then tried to execute it "java -cp X.jar X".
After some trial and error I noticed that this
works ONLY when jogl.dll is in the same directory.
Try, for example, copying the .jar to another
directory (away from the "applet" one), and you'll
get an error. You end up having to copy the jogl.dll
file. I also had to copy a texture map image file
that was needed even though this file is located
in the .jar.

try http://www.cise.ufl.edu/~fishwick/proc/test.zip

download it anywhere and do java -cp Borg3.jar Borg3
to get it to work. Then try removing either the image
file or the jogl.dll file, and try again.

Re: create an application with openGL?
Reply #8 - May 25th, 2005, 9:23pm
 
Webstart application.

method 1: should work as long as the server stays up

http://sand.cise.ufl.edu:35380/jsp-examples/processing/Borg4.jsp

method 2: You should right click, save target, and you may
need to rename the file to Borg4.jnlp since for
some reason IE changes the file name to .xml
(java web start is assumed to be installed):


http://www.cise.ufl.edu/~fishwick/proc/Borg4.jnlp

PRESS "q" to quit the full screen operation

Re: create an application with openGL?
Reply #9 - May 30th, 2005, 1:25pm
 
i get this while running "java -cp Borg3.jar Borg3" in linux:
Error while running applet.
java.lang.RuntimeException: Before using OpenGL, you must first select Import Library > opengl from the Sketch menu.
       at processing.core.PApplet.size(PApplet.java:757)
       at Borg3.setup(Borg3.java:31)
       at processing.core.PApplet.display(PApplet.java:1017)
       at processing.core.PGraphics.requestDisplay(PGraphics.java:362)
       at processing.core.PApplet.run(PApplet.java:921)
       at java.lang.Thread.run(Thread.java:534)

i figured it was because i run linux and it was looking for jogl.dll no jogl.so so i moved that into the current directory but no dice. anyone got ideas?
Re: create an application with openGL?
Reply #10 - May 30th, 2005, 7:37pm
 
Try this:

1) Download http://www.cise.ufl.edu/~fishwick/proc/Borg3Test.zip
2) Install into your Processing sketch area
3) Ensure that it runs within the Processing IDE
4) Export to create the applet directory
5) Copy the HEAT_STRESSED.JPG texture map from the
   data subdirectory to the applet directory. For
   some reason, this is necessary even though it is
   in the Borg3.jar file.
6) Try java -cp Borg3.jar Borg3 from the applet
   directory

Re: create an application with openGL?
Reply #11 - Jun 1st, 2005, 3:12am
 
Any luck with running the application in a window rather than fullscreen?

Omitting the "--present" from the PApplet.main call and running through "java -cp" will do just that, but the size of the window I get is wrong.

Thanks,

Michele
Re: create an application with openGL?
Reply #12 - Jun 3rd, 2005, 12:00am
 
I had exactly the same question, which is why I posted:

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

Re: create an application with openGL?
Reply #13 - Jun 4th, 2005, 7:26pm
 
I see.

From looking at the code in the CVS, it seems that the applet should work correctly in windowed mode by just omitting the --present (and perhaps --display) arguments. I see code that would presumably resize the applet window when size() is called from Processing.

But maybe things aren't working right, yet. And Ben seemed to imply that he was still working on this.
Re: create an application with openGL?
Reply #14 - Jun 4th, 2005, 11:28pm
 
right-o.. not yet implemented fully.
Pages: 1 2