Skip to content

Commit eb7da69

Browse files
committed
Get max core profile on OSX
1 parent 4f4941c commit eb7da69

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

core/src/processing/opengl/PGL.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1689,6 +1689,8 @@ protected static String[] preprocessFragmentSource(String[] fragSrc0,
16891689
fragSrc[0] = "#version " + version;
16901690
fragSrc[1] = "out vec4 fragColor;";
16911691

1692+
PApplet.printArray(fragSrc);
1693+
16921694
return fragSrc;
16931695
}
16941696
return fragSrc0;
@@ -1714,6 +1716,8 @@ protected static String[] preprocessVertexSource(String[] vertSrc0,
17141716
String[] vertSrc = preprocessShaderSource(vertSrc0, search, replace, 1);
17151717
vertSrc[0] = "#version " + version;
17161718

1719+
PApplet.printArray(vertSrc);
1720+
17171721
return vertSrc;
17181722
}
17191723
return vertSrc0;

core/src/processing/opengl/PJOGL.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ protected Object getDerivedFont(Object font, float size) {
12401240

12411241
@Override
12421242
protected String[] loadVertexShader(String filename, int version) {
1243-
if (PApplet.platform == PConstants.MACOSX) {
1243+
if (PApplet.platform == PConstants.WINDOWS) {
12441244
String[] fragSrc0 = pg.parent.loadStrings(filename);
12451245
return preprocessFragmentSource(fragSrc0, 130);
12461246
} else {
@@ -1251,7 +1251,7 @@ protected String[] loadVertexShader(String filename, int version) {
12511251

12521252
@Override
12531253
protected String[] loadFragmentShader(String filename, int version) {
1254-
if (PApplet.platform == PConstants.MACOSX) {
1254+
if (PApplet.platform == PConstants.WINDOWS) {
12551255
String[] vertSrc0 = pg.parent.loadStrings(filename);
12561256
return preprocessVertexSource(vertSrc0, 130);
12571257
} else {
@@ -1263,7 +1263,7 @@ protected String[] loadFragmentShader(String filename, int version) {
12631263
@Override
12641264
protected String[] loadFragmentShader(URL url, int version) {
12651265
try {
1266-
if (PApplet.platform == PConstants.MACOSX) {
1266+
if (PApplet.platform == PConstants.WINDOWS) {
12671267
String[] fragSrc0 = PApplet.loadStrings(url.openStream());
12681268
return preprocessFragmentSource(fragSrc0, 130);
12691269
} else {
@@ -1279,7 +1279,7 @@ protected String[] loadFragmentShader(URL url, int version) {
12791279
@Override
12801280
protected String[] loadVertexShader(URL url, int version) {
12811281
try {
1282-
if (PApplet.platform == PConstants.MACOSX) {
1282+
if (PApplet.platform == PConstants.WINDOWS) {
12831283
String[] vertSrc0 = PApplet.loadStrings(url.openStream());
12841284
return preprocessVertexSource(vertSrc0, 130);
12851285
} else {

core/src/processing/opengl/PSurfaceJOGL.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ protected void initGL() {
195195
if (profile == null) {
196196
if (PJOGL.profile == 2) {
197197
try {
198-
profile = GLProfile.getGL2ES2();
198+
if (PApplet.platform == PConstants.MACOSX) {
199+
profile = GLProfile.getMaxProgrammableCore(true);
200+
} else {
201+
profile = GLProfile.getGL2ES2();
202+
}
199203
} catch (GLException ex) {
200204
profile = GLProfile.getMaxProgrammable(true);
201205
}

0 commit comments

Comments
 (0)