You need adopt the idea of "locking". When you press the mouse down over your marker have it locked to the mouse - wherever the mouse may go until you release the mousebutton.
Code:
Draggable thing;
void setup(){
size(200, 200);
smooth();
thing = new Draggable(100, 100);
}
void draw(){
background(130);
thing.draw();
}
class Draggable{
float x, y;
boolean locked;
Draggable(float x, float y){
this.x = x;
this.y = y;
}
void draw(){
ellipse(x, y, 20, 20);
if(mousePressed && over()){
locked = true;
}
if(!mousePressed){
locked = false;
}
if(locked){
x = mouseX;
y = mouseY;
}
}
boolean over(){
if(dist(mouseX, mouseY, x, y) < 20){
return true;
}else{
return false;
}
}
}
This has nothing to do with processor speed. It's just method. On a really crap laptop you can click and hold on the browser scroll bar and it will still follow the mouse when you move the pointer off of it.
Yes, XP does run Java slow. I've also had OPENGL mode issues on a PC that are munting awful to code around. Ask Santa for a G5 for Christmas. On the flipside a lot of manufacturers of hardware (like micro controllers and webcams) don't bother to support Macs. Then again your Dell laptop could be setting fire to your bedroom right now.
It's like Ataris and Amigas all over again. Despite being crapper than Amiga there were somethings on the Atari that just worked better.
My advice is simply to pick the right machine for the right place. Or change your code to suit your machine. Or write faster code. You can perform simple speed tests by doing the following:
Code:
int timer;
void setup(){
timer = millis();
for(int i = 0; i < 1000; i++){
//insert function to speed test here
}
println(millis() - timer);
}