aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-01-12 00:37:13 +0000
committerCarsten Weisse <[email protected]>2005-01-12 00:37:13 +0000
commit0469ab14cbcce04f0e7e8688c438afaa8a323e43 (patch)
tree5e6cdebf203cc134be87e5bb7b9a6e6913d14347 /src/jake2/render
parentb3852ef1bb6b8d9775a3f63aa5112cce1f59b5bf (diff)
new methods for driver selection (see VID)
Diffstat (limited to 'src/jake2/render')
-rw-r--r--src/jake2/render/Renderer.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/jake2/render/Renderer.java b/src/jake2/render/Renderer.java
index e20332c..6141d0c 100644
--- a/src/jake2/render/Renderer.java
+++ b/src/jake2/render/Renderer.java
@@ -2,7 +2,7 @@
* Renderer.java
* Copyright (C) 2003
*
- * $Id: Renderer.java,v 1.5 2004-12-16 21:13:06 cawe Exp $
+ * $Id: Renderer.java,v 1.6 2005-01-12 00:37:13 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -43,7 +43,6 @@ public class Renderer {
try {
Class.forName("net.java.games.jogl.GL");
Class.forName("jake2.render.JoglRenderer");
- Class.forName("jake2.render.FastJoglRenderer");
} catch (ClassNotFoundException e) {
// ignore the jogl drivers if runtime not in classpath
}
@@ -53,6 +52,12 @@ public class Renderer {
} catch (ClassNotFoundException e) {
// ignore the lwjgl driver if runtime not in classpath
}
+ try {
+ Class.forName("net.java.games.jogl.GL");
+ Class.forName("jake2.render.FastJoglRenderer");
+ } catch (ClassNotFoundException e) {
+ // ignore the fastjogl drivers if runtime not in classpath
+ }
} catch (Throwable e) {
e.printStackTrace();
}
@@ -84,8 +89,17 @@ public class Renderer {
// null if driver not found
return null;
}
+
+ public static String getDefaultName() {
+ return (drivers.isEmpty()) ? null : ((Ref) drivers.firstElement()).getName();
+ }
+
+ public static String getPreferedName() {
+ return (drivers.isEmpty()) ? null : ((Ref) drivers.lastElement()).getName();
+ }
public static String[] getDriverNames() {
+ if (drivers.isEmpty()) return null;
int count = drivers.size();
String[] names = new String[count];
for (int i = 0; i < count; i++) {