Skip to content

Commit 8f2c775

Browse files
committed
Improve OpenGL extensions checks
1 parent a9460e8 commit 8f2c775

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

core/src/processing/opengl/PGL.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,10 +743,9 @@ private boolean needFBOLayer(boolean clear0) {
743743

744744

745745
private void createFBOLayer() {
746-
String ext = getString(EXTENSIONS);
747746
float scale = pg.getPixelScale();
748747

749-
if (-1 < ext.indexOf("texture_non_power_of_two")) {
748+
if (hasNpotTexSupport()) {
750749
fboWidth = (int)(scale * pg.width);
751750
fboHeight = (int)(scale * pg.height);
752751
} else {
@@ -755,14 +754,14 @@ private void createFBOLayer() {
755754
}
756755

757756
int maxs = maxSamples();
758-
if (-1 < ext.indexOf("_framebuffer_multisample") && 1 < maxs) {
757+
if (hasFboMultisampleSupport() && 1 < maxs) {
759758
numSamples = PApplet.min(reqNumSamples, maxs);
760759
} else {
761760
numSamples = 1;
762761
}
763762
boolean multisample = 1 < numSamples;
764763

765-
boolean packed = ext.indexOf("packed_depth_stencil") != -1;
764+
boolean packed = hasPackedDepthStencilSupport();
766765
int depthBits = PApplet.min(REQUESTED_DEPTH_BITS, getDepthBits());
767766
int stencilBits = PApplet.min(REQUESTED_STENCIL_BITS, getStencilBits());
768767

0 commit comments

Comments
 (0)