From 2d3d8585b63f9117a414800ec9b8a4209da7fec6 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 16 Apr 2003 20:28:20 +0000 Subject: [PATCH] Merged cfmdobbie's gl version checking --- src/java/org/lwjgl/opengl/GL.java | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/java/org/lwjgl/opengl/GL.java b/src/java/org/lwjgl/opengl/GL.java index 2e78e5ff..df37d2cb 100644 --- a/src/java/org/lwjgl/opengl/GL.java +++ b/src/java/org/lwjgl/opengl/GL.java @@ -1582,6 +1582,7 @@ public class GL extends CoreGL implements GLConstants { public boolean SGIS_generate_mipmap; public boolean SGIX_shadow; public boolean SGIX_depth_texture; + public boolean OpenGL10; public boolean OpenGL11; public boolean OpenGL12; public boolean OpenGL13; @@ -1628,15 +1629,21 @@ public class GL extends CoreGL implements GLConstants { int i = version.indexOf("1."); if (i > -1) { char c = version.charAt(i + 2); - if (c == '2') { - OpenGL12 = true; - } else if (c == '3') { - OpenGL12 = true; - OpenGL13 = true; - } else if (c == '4') { - OpenGL12 = true; - OpenGL13 = true; - OpenGL14 = true; + // Each case intentionally falls through! + switch (c) { + case '4': + OpenGL14 = true; + case '3': + OpenGL13 = true; + case '2': + OpenGL12 = true; + case '1': + OpenGL11 = true; + case '0': + OpenGL10 = true; + break ; + default: + // Unexpected character - ignore } } }