fix setup of firstMouse and pmouseX/Y

This commit is contained in:
benfry
2005-02-12 19:51:13 +00:00
parent 72dc17da83
commit dfb8588b1c
4 changed files with 33 additions and 7 deletions
+7 -4
View File
@@ -87,7 +87,7 @@ public class PApplet extends Applet
* (frameCount == 0) won't work since mouseXxxxx() may not be called
* until a couple frames into things.
*/
boolean firstMouse;
public boolean firstMouse;
public boolean mousePressed;
public MouseEvent mouseEvent;
@@ -802,14 +802,15 @@ public class PApplet extends Applet
draw();
// dmouseX/Y is updated only once per frame
dmouseX = mouseX;
dmouseY = mouseY;
// these are called *after* loop so that valid
// drawing commands can be run inside them. it can't
// be before, since a call to background() would wipe
// out anything that had been drawn so far.
dequeueMouseEvents();
// dmouseX/Y is updated only once per frame
dmouseX = mouseX;
dmouseY = mouseY;
dequeueKeyEvents();
if (THREAD_DEBUG) println(Thread.currentThread().getName() +
@@ -958,6 +959,8 @@ public class PApplet extends Applet
if (firstMouse) {
pmouseX = mouseX;
pmouseY = mouseY;
dmouseX = mouseX;
dmouseY = mouseY;
firstMouse = false;
}
+1 -1
View File
@@ -49,7 +49,7 @@ public class PSound {
//int length;
int position;
int data[];
int data[]; // 16 bit, from -32768 to +32767
public PSound() { } // for 1.3 subclass
+7 -2
View File
@@ -1,6 +1,7 @@
0077 core
X bring back pmouseX/Y using a tricky method of storing separate
X values for inside draw() versus inside the event handler versions
X debug handling, and make firstMouse public
covered in previous
X before graphics engine change, attach jogl stuff
@@ -32,17 +33,21 @@ X add gzipInput and gzipOutput
_ get regular graphics engine working again
_ look for size() method to determine default size of applet
_ (same as applet exporter function)
_ when using core graphics, don't show applet frame until first frame
_ (in opengl, open frame early, make sure this isn't inhibited)
_ default to single byte input from serial port
_ and add serial.setBuffer() for message length as alternative
_ or serial.setDelimiter() to fire message on delim
_ light(x, y, z, c1, c2, c3, TYPE)
_ also BLight with same constructor, and on() and off() fxn
_ be consistent about getXxx() methods
//
_ be consistent about getXxx() methods
_ basic sample audio playback needed for p5
_ make separate java 1.1 and java 1.3 classes