From 55d154b136e91944d01e0534b4c6153c2659328e Mon Sep 17 00:00:00 2001 From: Jakub Valtar Date: Sun, 16 Aug 2015 22:37:09 -0400 Subject: [PATCH] Improve OpenGL extensions checks --- core/src/processing/opengl/PGL.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/processing/opengl/PGL.java b/core/src/processing/opengl/PGL.java index a4109ea76..650bfd995 100644 --- a/core/src/processing/opengl/PGL.java +++ b/core/src/processing/opengl/PGL.java @@ -743,10 +743,9 @@ public abstract class PGL { private void createFBOLayer() { - String ext = getString(EXTENSIONS); float scale = pg.getPixelScale(); - if (-1 < ext.indexOf("texture_non_power_of_two")) { + if (hasNpotTexSupport()) { fboWidth = (int)(scale * pg.width); fboHeight = (int)(scale * pg.height); } else { @@ -755,14 +754,14 @@ public abstract class PGL { } int maxs = maxSamples(); - if (-1 < ext.indexOf("_framebuffer_multisample") && 1 < maxs) { + if (hasFboMultisampleSupport() && 1 < maxs) { numSamples = PApplet.min(reqNumSamples, maxs); } else { numSamples = 1; } boolean multisample = 1 < numSamples; - boolean packed = ext.indexOf("packed_depth_stencil") != -1; + boolean packed = hasPackedDepthStencilSupport(); int depthBits = PApplet.min(REQUESTED_DEPTH_BITS, getDepthBits()); int stencilBits = PApplet.min(REQUESTED_STENCIL_BITS, getStencilBits());