Skip to content

Commit be27f88

Browse files
committed
added static version field to PGLES
1 parent a650bc4 commit be27f88

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

core/src/processing/opengl/PGLES.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public class PGLES extends PGL {
5858
/** The current surface view */
5959
public GLSurfaceView glview;
6060

61+
62+
/** Requested major version of the OpenGL ES context */
63+
static public int version = 2;
64+
6165
// ........................................................
6266

6367
// Static initialization for some parameters that need to be different for

core/src/processing/opengl/PSurfaceGLES.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public SurfaceViewGLES(Context context, SurfaceHolder holder) {
118118
h.addCallback(this);
119119

120120
// Tells the default EGLContextFactory and EGLConfigChooser to create an GLES2 context.
121-
setEGLContextClientVersion(2);
121+
setEGLContextClientVersion(PGLES.version);
122122
setPreserveEGLContextOnPause(true);
123123

124124
int samples = sketch.sketchSmooth();
@@ -295,7 +295,7 @@ protected class ContextFactoryGLES implements
295295
GLSurfaceView.EGLContextFactory {
296296
public EGLContext createContext(EGL10 egl, EGLDisplay display,
297297
EGLConfig eglConfig) {
298-
int[] attrib_list = { PGLES.EGL_CONTEXT_CLIENT_VERSION, 2,
298+
int[] attrib_list = { PGLES.EGL_CONTEXT_CLIENT_VERSION, PGLES.version,
299299
EGL10.EGL_NONE };
300300
EGLContext context = egl.eglCreateContext(display, eglConfig,
301301
EGL10.EGL_NO_CONTEXT,

0 commit comments

Comments
 (0)