removed GL check from setPrimary(), added to Android's PApplet

This commit is contained in:
codeanticode
2012-09-10 20:19:49 +00:00
parent 1c57d0829d
commit 5dd6e714b2
3 changed files with 6 additions and 12 deletions
@@ -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;
@@ -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 " +
@@ -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 " +