removed unused fields in PJOGL, renamed profile

This commit is contained in:
codeanticode
2015-06-18 15:12:10 -04:00
parent 16c5655243
commit 70b1809684
2 changed files with 10 additions and 31 deletions

View File

@@ -23,7 +23,6 @@
package processing.opengl;
import java.awt.Canvas;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Shape;
@@ -36,9 +35,6 @@ import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.IntBuffer;
//import java.util.concurrent.CountDownLatch;
import com.jogamp.opengl.GL;
import com.jogamp.opengl.GL2;
@@ -50,10 +46,6 @@ import com.jogamp.opengl.GLAutoDrawable;
import com.jogamp.opengl.GLCapabilitiesImmutable;
import com.jogamp.opengl.GLContext;
import com.jogamp.opengl.GLDrawable;
//import javax.media.opengl.GLEventListener;
//import javax.media.opengl.GLFBODrawable;
import com.jogamp.opengl.GLProfile;
//import javax.media.opengl.awt.GLCanvas;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.glu.GLU;
import com.jogamp.opengl.glu.GLUtessellator;
@@ -64,17 +56,10 @@ import processing.core.PGraphics;
import processing.opengl.PGL;
import processing.opengl.PGraphicsOpenGL;
//import com.jogamp.newt.awt.NewtCanvasAWT;
//import com.jogamp.newt.opengl.GLWindow;
//import com.jogamp.opengl.FBObject;
public class PJOGL extends PGL {
// OpenGL profile to use (2, 3 or 4)
public static int PROFILE = 2;
// Enables/disables Retina support on OSX
public static boolean RETINA = false;
public static int profile = 2;
// The two windowing toolkits available to use in JOGL:
public static final int AWT = 0; // http://jogamp.org/wiki/index.php/Using_JOGL_in_AWT_SWT_and_Swing
@@ -93,12 +78,6 @@ public class PJOGL extends PGL {
/** The rendering context (holds rendering state info) */
public GLContext context;
/** The canvas where OpenGL rendering takes place */
public Canvas canvas;
/** Selected GL profile */
public static GLProfile profile;
// ........................................................
// Additional parameters
@@ -1193,7 +1172,7 @@ public class PJOGL extends PGL {
@Override
protected void enableTexturing(int target) {
if (PROFILE == 2) enable(target);
if (profile == 2) enable(target);
if (target == TEXTURE_2D) {
texturingTargets[0] = true;
} else if (target == TEXTURE_RECTANGLE) {
@@ -1204,7 +1183,7 @@ public class PJOGL extends PGL {
@Override
protected void disableTexturing(int target) {
if (PROFILE == 2) disable(target);
if (profile == 2) disable(target);
if (target == TEXTURE_2D) {
texturingTargets[0] = false;
} else if (target == TEXTURE_RECTANGLE) {
@@ -1243,7 +1222,7 @@ public class PJOGL extends PGL {
@Override
protected String[] loadVertexShader(String filename, int version) {
if (2 < PROFILE && version < 150) {
if (2 < profile && version < 150) {
String[] fragSrc0 = pg.parent.loadStrings(filename);
return convertFragmentSource(fragSrc0, version, 150);
} else {
@@ -1254,7 +1233,7 @@ public class PJOGL extends PGL {
@Override
protected String[] loadFragmentShader(String filename, int version) {
if (2 < PROFILE && version < 150) {
if (2 < profile && version < 150) {
String[] vertSrc0 = pg.parent.loadStrings(filename);
return convertVertexSource(vertSrc0, version, 150);
} else {
@@ -1266,7 +1245,7 @@ public class PJOGL extends PGL {
@Override
protected String[] loadFragmentShader(URL url, int version) {
try {
if (2 < PROFILE && version < 150) {
if (2 < profile && version < 150) {
String[] fragSrc0 = PApplet.loadStrings(url.openStream());
return convertFragmentSource(fragSrc0, version, 150);
} else {
@@ -1282,7 +1261,7 @@ public class PJOGL extends PGL {
@Override
protected String[] loadVertexShader(URL url, int version) {
try {
if (2 < PROFILE && version < 150) {
if (2 < profile && version < 150) {
String[] vertSrc0 = PApplet.loadStrings(url.openStream());
return convertVertexSource(vertSrc0, version, 150);
} else {

View File

@@ -160,13 +160,13 @@ public class PSurfaceJOGL implements PSurface {
protected void initGL() {
// System.out.println("*******************************");
if (profile == null) {
if (PJOGL.PROFILE == 2) {
if (PJOGL.profile == 2) {
try {
profile = GLProfile.getGL2ES1();
} catch (GLException ex) {
profile = GLProfile.getMaxFixedFunc(true);
}
} else if (PJOGL.PROFILE == 3) {
} else if (PJOGL.profile == 3) {
try {
profile = GLProfile.getGL2GL3();
} catch (GLException ex) {
@@ -175,7 +175,7 @@ public class PSurfaceJOGL implements PSurface {
if (!profile.isGL3()) {
PGraphics.showWarning("Requested profile GL3 but is not available, got: " + profile);
}
} else if (PJOGL.PROFILE == 4) {
} else if (PJOGL.profile == 4) {
try {
profile = GLProfile.getGL4ES3();
} catch (GLException ex) {