Skip to content

Commit 445cb17

Browse files
committed
removed unused fields in PJOGL, renamed profile
1 parent 8707194 commit 445cb17

2 files changed

Lines changed: 10 additions & 31 deletions

File tree

core/src/processing/opengl/PJOGL.java

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
package processing.opengl;
2525

26-
import java.awt.Canvas;
2726
import java.awt.Font;
2827
import java.awt.FontMetrics;
2928
import java.awt.Shape;
@@ -36,9 +35,6 @@
3635
import java.nio.ByteBuffer;
3736
import java.nio.FloatBuffer;
3837
import java.nio.IntBuffer;
39-
//import java.util.concurrent.CountDownLatch;
40-
41-
4238

4339
import com.jogamp.opengl.GL;
4440
import com.jogamp.opengl.GL2;
@@ -50,10 +46,6 @@
5046
import com.jogamp.opengl.GLCapabilitiesImmutable;
5147
import com.jogamp.opengl.GLContext;
5248
import com.jogamp.opengl.GLDrawable;
53-
//import javax.media.opengl.GLEventListener;
54-
//import javax.media.opengl.GLFBODrawable;
55-
import com.jogamp.opengl.GLProfile;
56-
//import javax.media.opengl.awt.GLCanvas;
5749
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
5850
import com.jogamp.opengl.glu.GLU;
5951
import com.jogamp.opengl.glu.GLUtessellator;
@@ -64,17 +56,10 @@
6456
import processing.opengl.PGL;
6557
import processing.opengl.PGraphicsOpenGL;
6658

67-
//import com.jogamp.newt.awt.NewtCanvasAWT;
68-
//import com.jogamp.newt.opengl.GLWindow;
69-
//import com.jogamp.opengl.FBObject;
70-
7159

7260
public class PJOGL extends PGL {
7361
// OpenGL profile to use (2, 3 or 4)
74-
public static int PROFILE = 2;
75-
76-
// Enables/disables Retina support on OSX
77-
public static boolean RETINA = false;
62+
public static int profile = 2;
7863

7964
// The two windowing toolkits available to use in JOGL:
8065
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 {
9378
/** The rendering context (holds rendering state info) */
9479
public GLContext context;
9580

96-
/** The canvas where OpenGL rendering takes place */
97-
public Canvas canvas;
98-
99-
/** Selected GL profile */
100-
public static GLProfile profile;
101-
10281
// ........................................................
10382

10483
// Additional parameters
@@ -1193,7 +1172,7 @@ public void keyTyped(com.jogamp.newt.event.KeyEvent e) {
11931172

11941173
@Override
11951174
protected void enableTexturing(int target) {
1196-
if (PROFILE == 2) enable(target);
1175+
if (profile == 2) enable(target);
11971176
if (target == TEXTURE_2D) {
11981177
texturingTargets[0] = true;
11991178
} else if (target == TEXTURE_RECTANGLE) {
@@ -1204,7 +1183,7 @@ protected void enableTexturing(int target) {
12041183

12051184
@Override
12061185
protected void disableTexturing(int target) {
1207-
if (PROFILE == 2) disable(target);
1186+
if (profile == 2) disable(target);
12081187
if (target == TEXTURE_2D) {
12091188
texturingTargets[0] = false;
12101189
} else if (target == TEXTURE_RECTANGLE) {
@@ -1243,7 +1222,7 @@ protected Object getDerivedFont(Object font, float size) {
12431222

12441223
@Override
12451224
protected String[] loadVertexShader(String filename, int version) {
1246-
if (2 < PROFILE && version < 150) {
1225+
if (2 < profile && version < 150) {
12471226
String[] fragSrc0 = pg.parent.loadStrings(filename);
12481227
return convertFragmentSource(fragSrc0, version, 150);
12491228
} else {
@@ -1254,7 +1233,7 @@ protected String[] loadVertexShader(String filename, int version) {
12541233

12551234
@Override
12561235
protected String[] loadFragmentShader(String filename, int version) {
1257-
if (2 < PROFILE && version < 150) {
1236+
if (2 < profile && version < 150) {
12581237
String[] vertSrc0 = pg.parent.loadStrings(filename);
12591238
return convertVertexSource(vertSrc0, version, 150);
12601239
} else {
@@ -1266,7 +1245,7 @@ protected String[] loadFragmentShader(String filename, int version) {
12661245
@Override
12671246
protected String[] loadFragmentShader(URL url, int version) {
12681247
try {
1269-
if (2 < PROFILE && version < 150) {
1248+
if (2 < profile && version < 150) {
12701249
String[] fragSrc0 = PApplet.loadStrings(url.openStream());
12711250
return convertFragmentSource(fragSrc0, version, 150);
12721251
} else {
@@ -1282,7 +1261,7 @@ protected String[] loadFragmentShader(URL url, int version) {
12821261
@Override
12831262
protected String[] loadVertexShader(URL url, int version) {
12841263
try {
1285-
if (2 < PROFILE && version < 150) {
1264+
if (2 < profile && version < 150) {
12861265
String[] vertSrc0 = PApplet.loadStrings(url.openStream());
12871266
return convertVertexSource(vertSrc0, version, 150);
12881267
} else {

core/src/processing/opengl/PSurfaceJOGL.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ protected void initScreen() {
160160
protected void initGL() {
161161
// System.out.println("*******************************");
162162
if (profile == null) {
163-
if (PJOGL.PROFILE == 2) {
163+
if (PJOGL.profile == 2) {
164164
try {
165165
profile = GLProfile.getGL2ES1();
166166
} catch (GLException ex) {
167167
profile = GLProfile.getMaxFixedFunc(true);
168168
}
169-
} else if (PJOGL.PROFILE == 3) {
169+
} else if (PJOGL.profile == 3) {
170170
try {
171171
profile = GLProfile.getGL2GL3();
172172
} catch (GLException ex) {
@@ -175,7 +175,7 @@ protected void initGL() {
175175
if (!profile.isGL3()) {
176176
PGraphics.showWarning("Requested profile GL3 but is not available, got: " + profile);
177177
}
178-
} else if (PJOGL.PROFILE == 4) {
178+
} else if (PJOGL.profile == 4) {
179179
try {
180180
profile = GLProfile.getGL4ES3();
181181
} catch (GLException ex) {

0 commit comments

Comments
 (0)