diff --git a/android/core/src/processing/core/PApplet.java b/android/core/src/processing/core/PApplet.java index b09d8a8e4..4a9ec5216 100644 --- a/android/core/src/processing/core/PApplet.java +++ b/android/core/src/processing/core/PApplet.java @@ -1604,8 +1604,14 @@ public class PApplet extends Activity implements PConstants, Runnable { if (irenderer.equals(JAVA2D)) { pg = new PGraphicsAndroid2D(); } else if (irenderer.equals(P2D)) { + if (!g.isGL()) { + throw new RuntimeException("createGraphics() with P2D requires size() to use P2D or P3D"); + } pg = new PGraphics2D(); } else if (irenderer.equals(P3D)) { + if (!g.isGL()) { + throw new RuntimeException("createGraphics() with P3D or OPENGL requires size() to use P2D or P3D"); + } pg = new PGraphics3D(); } else { Class rendererClass = null; diff --git a/android/core/src/processing/opengl/PGraphicsOpenGL.java b/android/core/src/processing/opengl/PGraphicsOpenGL.java index 1138e3474..da462a90b 100644 --- a/android/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/android/core/src/processing/opengl/PGraphicsOpenGL.java @@ -511,11 +511,6 @@ public class PGraphicsOpenGL extends PGraphics { @Override public void setPrimary(boolean primary) { super.setPrimary(primary); - if (!primary && !(parent.g instanceof PGraphicsOpenGL)) { - throw new RuntimeException("An OpenGL renderer (either P2D or P3D) " + - "cannot be created with a non-OpenGL main " + - "renderer (such as JAVA2D)"); - } format = ARGB; } @@ -6085,7 +6080,6 @@ public class PGraphicsOpenGL extends PGraphics { GLSL_VERSION = pgl.getString(PGL.SHADING_LANGUAGE_VERSION); int major = pgl.getGLVersion()[0]; - System.err.println("OpenGL version " + OPENGL_VERSION + " " + major); if (major < 2) { // There might be problems... PGraphics.showWarning("The OpenGL version in this is less than 2.0 so " + diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 1138e3474..da462a90b 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -511,11 +511,6 @@ public class PGraphicsOpenGL extends PGraphics { @Override public void setPrimary(boolean primary) { super.setPrimary(primary); - if (!primary && !(parent.g instanceof PGraphicsOpenGL)) { - throw new RuntimeException("An OpenGL renderer (either P2D or P3D) " + - "cannot be created with a non-OpenGL main " + - "renderer (such as JAVA2D)"); - } format = ARGB; } @@ -6085,7 +6080,6 @@ public class PGraphicsOpenGL extends PGraphics { GLSL_VERSION = pgl.getString(PGL.SHADING_LANGUAGE_VERSION); int major = pgl.getGLVersion()[0]; - System.err.println("OpenGL version " + OPENGL_VERSION + " " + major); if (major < 2) { // There might be problems... PGraphics.showWarning("The OpenGL version in this is less than 2.0 so " +