mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
removed GL check from setPrimary(), added to Android's PApplet
This commit is contained in:
@@ -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 " +
|
||||
|
||||
Reference in New Issue
Block a user