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 › Beginner: Using JOGL with Processing
Page Index Toggle Pages: 1
Beginner: Using JOGL with Processing (Read 579 times)
Beginner: Using JOGL with Processing
Feb 5th, 2008, 8:02pm
 
Hello. I'm a complete beginner with Processing (though not to programming) and I'm trying to use OpenGL.

I already downloaded JOGL and added the .jar files to my classpath, yet I cannot see the OpenGL examples.

Is there anything else I have to do in order to use the OpenGL renderer of Processing?

Thanks a lot.
Re: Beginner: Using JOGL with Processing
Reply #1 - Feb 5th, 2008, 9:09pm
 
You don't need to download JOGL at all.

Processing comes with JOGL built in, and to use it al you need is "import processing.opengl.*;" and "size(234,567,OPENGL);" (but with the dimensions you want naturally) and voila, everything is now running in OpenGL behind the scenes.

If you want access to the underlying OpenGL layer, it's slightly harder, but not impossible:

import javax.media.opengl.*; and later on, in the draw() function: GL gl=((PGraphicsOpenGL)g).beginGL(); do your GL stuff with the gl object, and then ((PGraphicsOpenGL)g).endGL();

Edit: Also it might be best if you remove the version of JOGL you downloaded to avoid it conflicting with the version that's bundled with processing.
Re: Beginner: Using JOGL with Processing
Reply #2 - Feb 5th, 2008, 9:26pm
 
Ahh. Thanks a lot!.

Actually, I was trying to view the examples *inside* the web page, just like the ones using the P3D renderer. I cut and paste the code and everything works.

Smiley

Thanks again
Page Index Toggle Pages: 1