oh yeah, *that's* why screen isn't static

This commit is contained in:
benfry
2010-03-04 14:03:19 +00:00
parent e89be2a053
commit 91bb309f3a
3 changed files with 23 additions and 16 deletions
+15 -2
View File
@@ -269,8 +269,21 @@ public class PApplet extends Applet
* Note that this won't update if you change the resolution
* of your screen once the the applet is running.
* <p>
* This variable is not static, because future releases need to be better
* at handling multiple displays.
* This variable is not static because in the desktop version of Processing,
* not all instances of PApplet will necessarily be started on a screen of
* the same size.
*/
static public int screenW;
static public int screenH;
static {
Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
screenW = size.width;
screenH = size.height;
}
/**
* Use screenW and screenH instead.
* @deprecated
*/
public Dimension screen =
Toolkit.getDefaultToolkit().getScreenSize();