Hey there! I'm new to processing.. Been tinkering with it a bit to make some custom drawing tools for use with my Wacom tablet. The last time I worked with this stuff was a few months back and I could sketch in realtime using the jpen library. It was really fun and great. Recently I ran some of my old programs, and they're crawlingly laggy.
When I run the actual jpen test program, it runs great.. But when I compile through processing it's painfully slow. Anyone have ideas what could be going on?
You'll need the jpen library and a Wacom tablet to test this out. Thanks a bunch for any suggestions.
import jpen.event.*;
import jpen.*;
void setup()
{
size(1600, 800);
PenManager pm = new PenManager(this);
pm.pen.addListener(new ProcessingPen());
smooth();
background(#FFFFFF);
}
void draw()
{
}
// Most of the code here is taken from the DrawingSurface demo code.
public class ProcessingPen extends PenAdapter
{
boolean bIsDown;
float prevXPos = -1, prevYPos = -1;
public void penButtonEvent(PButtonEvent evt)
{
// See if the pen is down
bIsDown = evt.pen.hasPressedButtons();
/* Or check with a finer granularity.
// Pen pressed is LEFT for me (Bamboo).
if (evt.pen.getButtonValue(PButton.Type.LEFT))
println("LEFT");
if (evt.pen.getButtonValue(PButton.Type.CENTER))
println("CENTER");
// Pen button pressed is RIGHT
if (evt.pen.getButtonValue(PButton.Type.RIGHT))
println("RIGHT");
//*/
}
public void penLevelEvent(PLevelEvent evt)
{
// Get kind of event: does it come from mouse (CURSOR), STYLUS or ERASER?