aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-05-07 18:23:26 +0000
committerCarsten Weisse <[email protected]>2005-05-07 18:23:26 +0000
commit79288e2165c844ff6435a868ea52a961f4aecbf7 (patch)
treee5025ad42a94bb9a684857c1a2b73ca4ee12f978
parent18826312798b2d0f90625253259be1b98cafbe53 (diff)
helper functions to get the OpenGL version as float value
-rw-r--r--src/jake2/render/fastjogl/Main.java4
-rw-r--r--src/jake2/render/glconfig_t.java14
-rw-r--r--src/jake2/render/jogl/Main.java4
-rw-r--r--src/jake2/render/lwjgl/Main.java4
4 files changed, 21 insertions, 5 deletions
diff --git a/src/jake2/render/fastjogl/Main.java b/src/jake2/render/fastjogl/Main.java
index 209d395..cc3ed27 100644
--- a/src/jake2/render/fastjogl/Main.java
+++ b/src/jake2/render/fastjogl/Main.java
@@ -2,7 +2,7 @@
* Main.java
* Copyright (C) 2003
*
- * $Id: Main.java,v 1.7 2005-04-07 15:25:49 cawe Exp $
+ * $Id: Main.java,v 1.8 2005-05-07 18:23:26 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -1120,6 +1120,8 @@ public abstract class Main extends Base {
VID.Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n');
gl_config.extensions_string = gl.glGetString(GL.GL_EXTENSIONS);
VID.Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n');
+
+ gl_config.parseOpenGLVersion();
String renderer_buffer = gl_config.renderer_string.toLowerCase();
String vendor_buffer = gl_config.vendor_string.toLowerCase();
diff --git a/src/jake2/render/glconfig_t.java b/src/jake2/render/glconfig_t.java
index 25f2198..8e4f49c 100644
--- a/src/jake2/render/glconfig_t.java
+++ b/src/jake2/render/glconfig_t.java
@@ -19,12 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 20.11.2003 by RST.
-// $Id: glconfig_t.java,v 1.1 2004-07-07 19:59:34 hzi Exp $
+// $Id: glconfig_t.java,v 1.2 2005-05-07 18:23:26 cawe Exp $
package jake2.render;
public class glconfig_t {
-
+
public int renderer;
public String renderer_string;
public String vendor_string;
@@ -32,4 +32,14 @@ public class glconfig_t {
public String extensions_string;
public boolean allow_cds;
+
+ private float version = 1.1f;
+
+ public void parseOpenGLVersion() {
+ version = Float.parseFloat(version_string.substring(0, 3));
+ }
+
+ public float getOpenGLVersion() {
+ return version;
+ }
}
diff --git a/src/jake2/render/jogl/Main.java b/src/jake2/render/jogl/Main.java
index 8feb5cf..7d2523a 100644
--- a/src/jake2/render/jogl/Main.java
+++ b/src/jake2/render/jogl/Main.java
@@ -2,7 +2,7 @@
* Main.java
* Copyright (C) 2003
*
- * $Id: Main.java,v 1.7 2005-04-07 15:25:49 cawe Exp $
+ * $Id: Main.java,v 1.8 2005-05-07 18:23:26 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -1118,6 +1118,8 @@ public abstract class Main extends Base {
VID.Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n');
gl_config.extensions_string = gl.glGetString(GL.GL_EXTENSIONS);
VID.Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n');
+
+ gl_config.parseOpenGLVersion();
String renderer_buffer = gl_config.renderer_string.toLowerCase();
String vendor_buffer = gl_config.vendor_string.toLowerCase();
diff --git a/src/jake2/render/lwjgl/Main.java b/src/jake2/render/lwjgl/Main.java
index 214bab8..4d1bd73 100644
--- a/src/jake2/render/lwjgl/Main.java
+++ b/src/jake2/render/lwjgl/Main.java
@@ -2,7 +2,7 @@
* Main.java
* Copyright (C) 2003
*
- * $Id: Main.java,v 1.6 2005-04-07 15:25:49 cawe Exp $
+ * $Id: Main.java,v 1.7 2005-05-07 18:23:25 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -1111,6 +1111,8 @@ public abstract class Main extends Base {
VID.Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n');
gl_config.extensions_string = gl.glGetString(GL11.GL_EXTENSIONS);
VID.Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n');
+
+ gl_config.parseOpenGLVersion();
String renderer_buffer = gl_config.renderer_string.toLowerCase();
String vendor_buffer = gl_config.vendor_string.toLowerCase();