disabled perspective correction for lines in P2D and handling loadPixels() call outside beginDraw/endDraw

This commit is contained in:
codeanticode
2012-05-10 19:27:03 +00:00
parent cb17c4b530
commit 1d0b3a27aa
2 changed files with 11 additions and 0 deletions
@@ -28,6 +28,7 @@ public class PGraphics2D extends PGraphicsOpenGL {
public PGraphics2D() {
super();
hints[ENABLE_ACCURATE_2D] = true;
hints[ENABLE_PERSPECTIVE_CORRECTED_LINES] = false;
}
}
@@ -4674,6 +4674,12 @@ public class PGraphicsOpenGL extends PGraphics {
// Initializes the pixels array, copying the current contents of the
// color buffer into it.
public void loadPixels() {
boolean needEndDraw = false;
if (!drawing) {
beginDraw();
needEndDraw = true;
}
if (!setgetPixels) {
// Draws any remaining geometry in case the user is still not
// setting/getting new pixels.
@@ -4690,6 +4696,10 @@ public class PGraphicsOpenGL extends PGraphics {
pixelsToTexture();
}
}
if (needEndDraw) {
endDraw();
}
}