Hello,
I'm trying to do some low-level OpenGL using the new P3D renderer in 2.04a. I banged my head against the wall for hours trying to figure out what was causing an exception in a very simple sketch:
Exception in thread "Animation Thread" java.lang.ClassCastException: processing.core.PGraphics3D cannot be cast to processing.opengl.PGraphicsOpenGL
The problem is the "import processing.xml.*" line - take it out and it works! How odd... is there some renderer code hidden away in the xml files? Or, is there a better way to use XML? I just spent the day writing an XML module that worked fine until I tried to cast the P3D renderer...
Thanks
Evan
I'm trying to do some low-level OpenGL using the new P3D renderer in 2.04a. I banged my head against the wall for hours trying to figure out what was causing an exception in a very simple sketch:
- import javax.media.opengl.GL;
- import javax.media.opengl.GL2;
- import processing.xml.*;
- GL gl;
- void setup()
- {
- size(320,240, P3D);
- gl = ((PGraphicsOpenGL)g).gl;
- }
- void draw()
- {
- // nothing
- }
Exception in thread "Animation Thread" java.lang.ClassCastException: processing.core.PGraphics3D cannot be cast to processing.opengl.PGraphicsOpenGL
The problem is the "import processing.xml.*" line - take it out and it works! How odd... is there some renderer code hidden away in the xml files? Or, is there a better way to use XML? I just spent the day writing an XML module that worked fine until I tried to cast the P3D renderer...
Thanks
Evan
1