codeanticode / tablet

Tablet is a library for using pen tablets from Processing.
http://processing.andrescolubri.net/libraries/tablet/
Other
24 stars 2 forks source link

Tablet library does not work with the OpenGL renderer in Processing 3 #4

Closed knupel closed 8 years ago

knupel commented 9 years ago

Processing 3.0b5 is incompatible with this version of the library. The sentence of the error is very long. But it's possible to check with the example of the library example "BasicDrawing.pde" Bug on mac OSX 10.9

knupel commented 9 years ago

java.lang.RuntimeException: com.jogamp.opengl.GLException: Caught VerifyError: Bad type on operand stack Exception Details: Location: codeanticode/tablet/Tablet.(Lprocessing/core/PApplet;)V @57: invokestatic Reason: Type 'processing/core/PApplet' (current frame, stack[0]) is not assignable to 'java/awt/Component' Current Frame: bci: @57 flags: { } locals: { 'codeanticode/tablet/Tablet', 'processing/core/PApplet', 'java/lang/Object' } stack: { 'processing/core/PApplet', 'codeanticode/tablet/Tablet' } Bytecode: 0x0000000: 2ab7 0001 2a2b b500 022a b700 032b b400 0x0000010: 04c1 0005 9900 2b2b b400 04c0 0005 b400 0x0000020: 06b6 0007 4d2c c100 0899 000e 2cc0 0008 0x0000030: 2ab8 0009 a700 082b 2ab8 0009 a700 082b 0x0000040: 2ab8 0009 2ab8 000a b500 0b2a bb00 0c59 0x0000050: b700 0db5 000e 2a2b b600 0f12 1004 bd00 0x0000060: 1159 0313 0012 53b6 0013 b500 14a7 0004 0x0000070: 4d2a 2bb6 000f 1216 04bd 0011 5903 1300 0x0000080: 1253 b600 13b5 0017 a700 044d 2a2b b600 0x0000090: 0f12 1804 bd00 1159 0313 0012 53b6 0013 0x00000a0: b500 19a7 0004 4d2a 2bb6 000f 121a 04bd 0x00000b0: 0011 5903 1300 1253 b600 13b5 001b a700 0x00000c0: 044d b1
Exception Handler Table: bci [86, 109] => handler: 112 bci [113, 136] => handler: 139 bci [140, 163] => handler: 166 bci [167, 190] => handler: 193 Stackmap Table: full_frame(@55,{Object[#99],Object[#100],Object[#101]},{}) chop_frame(@60,1) same_frame(@63) same_frame(@68) same_locals_1_stack_item_frame(@112,Object[#102]) same_frame(@113) same_locals_1_stack_item_frame(@139,Object[#102]) same_frame(@140) same_locals_1_stack_item_frame(@166,Object[#102]) same_frame(@167) same_locals_1_stack_item_frame(@193,Object[#102]) same_frame(@194) on thread main-Display-.macosx_nil-1-EDT-1 at jogamp.newt.DefaultEDTUtil.invokeImpl(DefaultEDTUtil.java:249) at jogamp.newt.DefaultEDTUtil.invoke(DefaultEDTUtil.java:163) at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:427) at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2133) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1024) at jogamp.newt.WindowImpl.setVisible(WindowImpl.java:1029) at com.jogamp.newt.opengl.GLWindow.setVisible(GLWindow.java:499) at processing.opengl.PSurfaceJOGL.setVisible(PSurfaceJOGL.java:387) at processing.core.PApplet.showSurface(PApplet.java:10256) at processing.core.PApplet.runSketch(PApplet.java:10240) at processing.core.PApplet.main(PApplet.java:9969) Caused by: com.jogamp.opengl.GLException: Caught VerifyError: Bad type on operand stack Exception Details: Location: codeanticode/tablet/Tablet.(Lprocessing/core/PApplet;)V @57: invokestatic Reason: Type 'processing/core/PApplet' (current frame, stack[0]) is not assignable to 'java/awt/Component' Current Frame: bci: @57 flags: { } locals: { 'codeanticode/tablet/Tablet', 'processing/core/PApplet', 'java/lang/Object' } stack: { 'processing/core/PApplet', 'codeanticode/tablet/Tablet' } Bytecode: 0x0000000: 2ab7 0001 2a2b b500 022a b700 032b b400 0x0000010: 04c1 0005 9900 2b2b b400 04c0 0005 b400 0x0000020: 06b6 0007 4d2c c100 0899 000e 2cc0 0008 0x0000030: 2ab8 0009 a700 082b 2ab8 0009 a700 082b 0x0000040: 2ab8 0009 2ab8 000a b500 0b2a bb00 0c59 0x0000050: b700 0db5 000e 2a2b b600 0f12 1004 bd00 0x0000060: 1159 0313 0012 53b6 0013 b500 14a7 0004 0x0000070: 4d2a 2bb6 000f 1216 04bd 0011 5903 1300 0x0000080: 1253 b600 13b5 0017 a700 044d 2a2b b600 0x0000090: 0f12 1804 bd00 1159 0313 0012 53b6 0013 0x00000a0: b500 19a7 0004 4d2a 2bb6 000f 121a 04bd 0x00000b0: 0011 5903 1300 1253 b600 13b5 001b a700 0x00000c0: 044d b1
Exception Handler Table: bci [86, 109] => handler: 112 bci [113, 136] => handler: 139 bci [140, 163] => handler: 166 bci [167, 190] => handler: 193 Stackmap Table: full_frame(@55,{Object[#99],Object[#100],Object[#101]},{}) chop_frame(@60,1) same_frame(@63) same_frame(@68) same_locals_1_stack_item_frame(@112,Object[#102]) same_frame(@113) same_locals_1_stack_item_frame(@139,Object[#102]) same_frame(@140) same_locals_1_stack_item_frame(@166,Object[#102]) same_frame(@167) same_locals_1_stack_item_frame(@193,Object[#102]) same_frame(@194) on thread main-Display-.macosx_nil-1-EDT-1 at com.jogamp.opengl.GLException.newGLException(GLException.java:76) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131) at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680) at jogamp.opengl.GLAutoDrawableBase.defaultWindowResizedOp(GLAutoDrawableBase.java:259) at com.jogamp.newt.opengl.GLWindow.access$200(GLWindow.java:119) at com.jogamp.newt.opengl.GLWindow$2.windowResized(GLWindow.java:141) at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3682) at jogamp.newt.WindowImpl.sendWindowEvent(WindowImpl.java:3616) at jogamp.newt.WindowImpl.setVisibleActionImpl(WindowImpl.java:1003) at jogamp.newt.WindowImpl$VisibleAction.run(WindowImpl.java:1015) at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:150) at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:372) Caused by: java.lang.VerifyError: Bad type on operand stack Exception Details: Location: codeanticode/tablet/Tablet.(Lprocessing/core/PApplet;)V @57: invokestatic Reason: Type 'processing/core/PApplet' (current frame, stack[0]) is not assignable to 'java/awt/Component' Current Frame: bci: @57 flags: { } locals: { 'codeanticode/tablet/Tablet', 'processing/core/PApplet', 'java/lang/Object' } stack: { 'processing/core/PApplet', 'codeanticode/tablet/Tablet' } Bytecode: 0x0000000: 2ab7 0001 2a2b b500 022a b700 032b b400 0x0000010: 04c1 0005 9900 2b2b b400 04c0 0005 b400 0x0000020: 06b6 0007 4d2c c100 0899 000e 2cc0 0008 0x0000030: 2ab8 0009 a700 082b 2ab8 0009 a700 082b 0x0000040: 2ab8 0009 2ab8 000a b500 0b2a bb00 0c59 0x0000050: b700 0db5 000e 2a2b b600 0f12 1004 bd00 0x0000060: 1159 0313 0012 53b6 0013 b500 14a7 0004 0x0000070: 4d2a 2bb6 000f 1216 04bd 0011 5903 1300 0x0000080: 1253 b600 13b5 0017 a700 044d 2a2b b600 0x0000090: 0f12 1804 bd00 1159 0313 0012 53b6 0013 0x00000a0: b500 19a7 0004 4d2a 2bb6 000f 121a 04bd 0x00000b0: 0011 5903 1300 1253 b600 13b5 001b a700 0x00000c0: 044d b1
Exception Handler Table: bci [86, 109] => handler: 112 bci [113, 136] => handler: 139 bci [140, 163] => handler: 166 bci [167, 190] => handler: 193 Stackmap Table: full_frame(@55,{Object[#99],Object[#100],Object[#101]},{}) chop_frame(@60,1) same_frame(@63) same_frame(@68) same_locals_1_stack_item_frame(@112,Object[#102]) same_frame(@113) same_locals_1_stack_item_frame(@139,Object[#102]) same_frame(@140) same_locals_1_stack_item_frame(@166,Object[#102]) same_frame(@167) same_locals_1_stack_item_frame(@193,Object[#102]) same_frame(@194)

at PreScene_28.presceneSetup(PreScene_28.java:248)
at PreScene_28.setup(PreScene_28.java:82)
at processing.core.PApplet.handleDraw(PApplet.java:2376)
at processing.opengl.PSurfaceJOGL$DrawListener.display(PSurfaceJOGL.java:654)
at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:691)
at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:673)
at jogamp.opengl.GLAutoDrawableBase$2.run(GLAutoDrawableBase.java:442)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1277)
... 11 more
codeanticode commented 9 years ago

yes, it needs to be updated. The GL renderer in Processing 3 doesn't use AWT anymore, but jpen2 does, so the solution might be tricky.

knupel commented 9 years ago

This Processing version is real big move, a lot of things and libraries are broken ! but I feel this Processing is quicker than before ! Good luck for this tricky part.

codeanticode commented 9 years ago

I could release a version of the library that works with the JAVA2D renderer almost immediately, unfortunately after looking at the source of jpen2 it seems that adding back support for GL would require implementing tablet input almost from scratch, since jpen2 depends very heavily on AWT.

knupel commented 9 years ago

May be is a stupid idea, but just import java.awt.* don't resolve the problem ? I tried that's don't work.

Sure finish the big work on Processing and Syphon is a big priority ! Not sure a lot of people use the tablet with processing :)

codeanticode commented 9 years ago

Maybe the jpen authors have some thoughts:

http://sourceforge.net/p/jpen/discussion/753961/thread/6ea88634/

knupel commented 9 years ago

I hope !

codeanticode commented 8 years ago

Implemented with https://github.com/codeanticode/tablet/commit/2c6df1f10ba0541dc34098abe806df41f07b4684

knupel commented 8 years ago

Hello,

Oups, the bug is back with Processing 3.1.1 in P3D

/**
 * Basic Drawing
 * by Andres Colubri. 
 * 
 * This program shows how to use the tilt values from the pen.
 */

import codeanticode.tablet.*;

Tablet tablet;

void setup() {
  size(640, 480, P3D);

  tablet = new Tablet(this); 

  background(0);
  stroke(200, 150);
  strokeWeight(2);  
}

void draw() {
  if (0 < tablet.getPressure()) {
    float x = tablet.getTiltX();
    float y = tablet.getTiltY();
    line(mouseX, mouseY, mouseX + 20 * x, mouseY + 20 * y);      
  }
}

return capture d ecran 2016-06-02 a 14 44 18

knupel commented 8 years ago

may be it's not a bug, just message to say is not possible ? I h-just understand that now. There is a plan to resolve or it's just a nigthmare to imagine resolve it ?