aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render/opengl/JoglGL2Driver.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jake2/render/opengl/JoglGL2Driver.java')
-rw-r--r--src/jake2/render/opengl/JoglGL2Driver.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/jake2/render/opengl/JoglGL2Driver.java b/src/jake2/render/opengl/JoglGL2Driver.java
index 2dd5710..c2ca450 100644
--- a/src/jake2/render/opengl/JoglGL2Driver.java
+++ b/src/jake2/render/opengl/JoglGL2Driver.java
@@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
package jake2.render.opengl;
+import jake2.game.cvar_t;
+import jake2.qcommon.Cvar;
import jake2.qcommon.xcommand_t;
import jake2.render.Base;
@@ -38,7 +40,16 @@ import com.jogamp.newt.ScreenMode;
*/
public abstract class JoglGL2Driver extends JoglGL2ES1 implements GLDriver {
- protected static GLProfile glp = GLProfile.get(GLProfile.GL2); // exception if n/a is desired
+ protected static final GLProfile glp;
+ static {
+ // exception if GLProfile is n/a is desired
+ cvar_t v = Cvar.Get("jogl_gl2", "1", 0);
+ if( v.value != 0f ) {
+ glp = GLProfile.get(GLProfile.GL2);
+ } else {
+ throw new GLException("GL2 is disabled");
+ }
+ }
protected JoglGL2Driver() {
super(true);