prevent attempts to do 2x on non-2x hardware

This commit is contained in:
Ben Fry
2015-06-08 18:31:14 -04:00
parent 10a5b6bebe
commit b8c7c5e7bd
3 changed files with 12 additions and 5 deletions

View File

@@ -1050,7 +1050,12 @@ public class PApplet implements PConstants {
if (density != 1 && density != 2) {
throw new RuntimeException("pixelDensity() can only be 1 or 2");
}
this.pixelDensity = density;
if (density == 2 && displayDensity() == 1) {
// Don't throw exception because the sketch should still work
System.err.println("pixelDensity(2) is not available for this display, using pixelDensity(1) instead");
} else {
this.pixelDensity = density;
}
}
}
}

View File

@@ -83,6 +83,10 @@ X just do pixelFactor() (and pull it during compilation)?
X add sketchPixelFactor() to handle the scenario?
X or is it just a boolean, because pixelFactor(2) is the only option?
X remove retina hint
X move checkRetina()/highResDisplay() to PApplet
X and out of Toolkit and PSurfaceAWT
X prevent running _2X renderers on non-2x hardware
X pixelDensity() needs to be called after size() or fullScreen()
andres/opengl
X set(0, 0, image) does not set alpha channel to opaque in P2D/P3D
@@ -134,7 +138,6 @@ _ sketch sometimes doesn't show with noLoop() on Linux
_ https://github.com/processing/processing/issues/3316
_ sketch not always showing with empty draw()
_ https://github.com/processing/processing/issues/3363
_ prevent running _2X renderers on non-2x hardware
_ PGraphic ignores PNG transparency (regression from 3.0a5)
_ https://github.com/processing/processing/issues/3317
_ strokeWeight() in setup() not working for default renderer
@@ -442,8 +445,6 @@ _ add requestFocus() method to PApplet (or surface?)
o destroy() removed, but bring back? is that better than dispose()?
_ destroy() only called dispose(), so no difference
_ Python Mode has a hook for when it's called
_ move checkRetina()/highResDisplay() to PApplet
_ and out of Toolkit and PSurfaceAWT
_ probably should also check to make sure PApplet running JVM 8
_ or compile against 1.8 and force it?

View File

@@ -27,7 +27,6 @@ o Update Windows icons for multiple sizes, implement them in the PDE
o http://code.google.com/p/processing/issues/detail?id=632
X closed during the 2.x cycle
contribs
X several Greek translation updates
X https://github.com/processing/processing/issues/3329
@@ -56,6 +55,8 @@ _ a checkbox for "show this welcome each time" (default to checked)
_ a button to dismiss the welcome screen (e.g., "get started")
_ 2.x vs 3.x sketchbook battle (part of the welcome screen item)
_ if a v2 sketchbook already exists, show a prompt to choose either creating a new Processing 3 sketch folder or use the existing v2 one, plus a link to GitHub wiki page with details
_ send list of installed Libraries, Modes, Tools, and Examples on update
_ https://github.com/processing/processing/issues/3365
gui