Hi,
I've been trying to play around with the Gestalt Processing plugin in eclipse. When I try to run any of the demo programs I get the following error
Code:Exception in thread "Animation Thread" java.lang.NoSuchFieldError: canvas
at gestalt.p5.GestaltPlugIn.create(GestaltPlugIn.java:199)
at gestalt.p5.GestaltPlugIn.<init>(GestaltPlugIn.java:131)
at gestalt.p5.GestaltPlugIn.<init>(GestaltPlugIn.java:96)
at gestalt.demo.processing.UsingOpenGL.setup(UsingOpenGL.java:57)
at processing.core.PApplet.handleDraw(PApplet.java:1403)
at processing.core.PApplet.run(PApplet.java:1328)
at java.lang.Thread.run(Unknown Source)
And here's the code for the demo I'm trying to run
Code:
package gestalt.demo.processing;
import javax.media.opengl.GL;
import javax.media.opengl.glu.GLU;
import gestalt.context.GLContext;
import gestalt.p5.GestaltPlugIn;
import gestalt.render.bin.RenderBin;
import gestalt.shape.AbstractDrawable;
import processing.core.PApplet;
public class UsingOpenGL
extends PApplet {
private GestaltPlugIn gestalt;
public void setup() {
/* setup p5 */
size(640, 480, OPENGL);
/* create gestalt plugin */
gestalt = new GestaltPlugIn(this);
/* remove all gestalt presets */
RenderBin myRenderBin = new RenderBin();
gestalt.setBinRef(myRenderBin);
myRenderBin.add(new RawOpenGL());
}
public void draw() {
background(0);
}
private class RawOpenGL
extends AbstractDrawable {
public void draw(final GLContext theContext) {
GL gl = gestalt.getGL();
GLU glu = gestalt.getGLU();
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
glu.gluPerspective(45.0f,
(float) width / (float) height,
1.0,
20.0);
gl.glMatrixMode(GL.GL_MODELVIEW);
gl.glLoadIdentity();
gl.glTranslatef( -1.5f, 0.0f, -6.0f);
gl.glBegin(GL.GL_TRIANGLES);
gl.glColor3f(1.0f, 0.0f, 0.0f);
gl.glVertex3f(0.0f, 1.0f, 0.0f);
gl.glColor3f(0.0f, 1.0f, 0.0f);
gl.glVertex3f( -1.0f, -1.0f, 0.0f);
gl.glColor3f(0.0f, 0.0f, 1.0f);
gl.glVertex3f(1.0f, -1.0f, 0.0f);
gl.glEnd();
gl.glTranslatef(3.0f, 0.0f, 0.0f);
gl.glBegin(GL.GL_QUADS);
gl.glColor3f(0.5f, 0.5f, 1.0f);
gl.glVertex3f( -1.0f, 1.0f, 0.0f);
gl.glVertex3f(1.0f, 1.0f, 0.0f);
gl.glVertex3f(1.0f, -1.0f, 0.0f);
gl.glVertex3f( -1.0f, -1.0f, 0.0f);
gl.glEnd();
}
}
public static void main(String[] args) {
PApplet.main(new String[] {UsingOpenGL.class.getName()});
}
}
Any ideas?
Thanks for you help