Posts: 8
Joined: Sat Oct 11, 2014 6:54 am

Processing P3D, Raspberry Pi, OpenGL doesn't work

Fri Jul 17, 2015 1:28 pm

to make "Processing" working on the RaspberryPI 2
i've downloaded and copied the content of
the package ... atforms.7z
inside the core\library folder of "processing 2.2.1"
(to solve the problem related to OpenGL least i hope to have understood something about the problem )

before this operation the "Processing" error was:

Code: Select all

glGetError 0x500
glGetError 0x500
java.lang.ClassCastException: cannot be cast to com.jogamp.nativewindow.awt.AWTGraphicsConfiguration
	at java.awt.Container.addImpl(
	at java.awt.Container.add(
	at processing.opengl.PJOGL.initSurface(
	at processing.opengl.PGraphicsOpenGL.initPrimary(
	at processing.opengl.PGraphicsOpenGL.requestDraw(

after that the error changed in :

Code: Select all

java.lang.NoClassDefFoundError: javax/media/opengl/GLException
	at processing.opengl.PGraphicsOpenGL.createPGL(
	at processing.opengl.PGraphicsOpenGL.<init>

	at processing.opengl.PGraphics3D.<init>(
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance

	at java.lang.reflect.Constructor.newInstance(
	at processing.core.PApplet.makeGraphics(

	at processing.core.PApplet.size(
	at MoveEye.setup(
	at processing.core.PApplet.handleDraw

	at processing.core.PGraphicsJava2D.requestDraw(

Caused by: java.lang.ClassNotFoundException:

	at Method)
	at java.lang.ClassLoader.loadClass

	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	... 15 more

have i forgotten to do something after having copied the jars? do i need to update some path or change some configuration? or do something else?

i'm not so skilled with linux, sorry
Don't ban me if i've used the wrong section of the forum or the question was already discussed, please :-(

-Raspberry 2
-Oracle Java 1.7.0_40-b43
-Processing 2.2.1

User avatar
Posts: 540
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Processing P3D, Raspberry Pi, OpenGL doesn't work

Fri Jul 17, 2015 3:13 pm

Hi Processing 2.x.x is built around the concept that all windows inherit a java applet surface and thus indirectly is using an AWT X11 Window surface.
The proprietary Broadcom Raspbery Pi OpenGL ES driver is using a dispmanx surface that is incompatible with AWT X11 Window surfaces.

JogAmp JOGL, that processing is using internally, can initialize the Broadcom specific dispmanx surface using the NEWT API.
Processing 3.x.x has removed all support for applets and thus switched from using AWT to NEWT for all P3D sketches!
This means that hardware acceleration with processing on the raspberry pi is possible when using Processing 3.

As a proof of concept
video: ... 245117.mp4

As you can see in this image NEWT uses the dispmanx api to provide a hardware accelerated window on top of the xorg window, NEWT also provide a "white" mousepointer.

The above image was generated by combining the latest jogl git + a patched version of processing to initialize a gl2es2 profile and removing some calls that cased runtime exceptions using the raspberry pi opengl es 2 driver. ... .0-rebased

I am collaborating with Gottfried Haider to merge all the changes to progessing that made this possible into the future Processing 3 release.

One alternative is to use the new free software Mesa3D vc4 OpenGL 2 driver.
The new Mesa3D vc4 driver expects use of AWT X11 Windows thus it shall work with both Processing 2 and Processing 3.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!

Return to “Java”