aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-19 10:11:59 +0200
committerSven Gothel <[email protected]>2012-10-19 10:11:59 +0200
commit4c41dbb44670b0420e5f804911e1f729662598b7 (patch)
tree2a538c21dc468e93e4fddbcde48b59aedb4e9608
parent5c21146b8fc75481b9ae164c2e9f5cfbfb8897a1 (diff)
Added JOGL2 Flags (README/Jake2.sh), New JOGL Renderer Order, ..
New JOGL Renderer Order, last comes first if not defined by 'vid_ref': - jogldummy - joglgl2 - jogles2 - jogles1 +++ README JOGL2 Flags: JOGL Renderer can be set via 'vid_ref', i.e. '+set vid_ref jogles2' - jogles1 ES1 renderer, may use GL2ES1 w/ 'jogl_gl2es1 1' - jogles2 ES1 renderer, may use GL2ES2 w/ 'jogl_gl2es2 1' - joglgl2 GL2 renderer, maybe disabled w/ 'jogl_gl2 0' - jogldummy NOP GL renderer to measure performance w/o GL costs Special GLProfile selection flags: - jogl_gl2 0 disable joglgl2, default enabled '1' - jogl_gl2es1 1 allow desktop GL2ES1 for jogles1 renderer, default disabled '0' - jogl_gl2es2 1 allow desktop GL2ES2 for jogles2 renderer, default disabled '0' Special drawable surface flags: - jogl_rgb565 1 requesting a RGB565 surface, otherwise request default RGB888 surface
-rw-r--r--Jake2.sh20
-rw-r--r--README37
-rw-r--r--README_DE82
-rw-r--r--src/jake2/render/JoglES1Renderer.java3
-rw-r--r--src/jake2/render/JoglES2Renderer.java2
-rw-r--r--src/jake2/render/JoglGL2Renderer.java3
-rw-r--r--src/jake2/render/Renderer.java20
-rw-r--r--src/jake2/render/opengl/DummyGL.java2
-rw-r--r--src/jake2/render/opengl/JoglES1Driver.java14
-rw-r--r--src/jake2/render/opengl/JoglES2Driver.java14
-rw-r--r--src/jake2/render/opengl/JoglGL2Driver.java13
-rw-r--r--src/jake2/render/opengl/JoglGL2ES1.java5
-rw-r--r--src/jake2/render/opengl/NEWTWin.java20
13 files changed, 108 insertions, 127 deletions
diff --git a/Jake2.sh b/Jake2.sh
index aad74a7..8befdc7 100644
--- a/Jake2.sh
+++ b/Jake2.sh
@@ -6,7 +6,7 @@ cd `dirname $0`
CP=lib/jogamp/gluegen-rt.jar:lib/jogamp/joal.jar:lib/jogamp/jogl-all.jar:dist/lib/jake2.jar
#breaks VM's like avian
-#X_ARGS="-Xmx100M"
+X_ARGS="-Xmx100M"
# should be redundant (AWT not used anyways), however, due to a bug in avian, it's required
D0_ARGS="-Djava.awt.headless=true"
@@ -21,12 +21,22 @@ D0_ARGS="-Djava.awt.headless=true"
#D_ARGS="-Djogl.debug.FixedFuncPipeline"
#D_ARGS="-Djogl.debug.GLSLCode"
#D_ARGS="-Djogl.debug.ImmModeSink.Buffer"
+#D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.CapabilitiesChooser"
+#D_ARGS="-Djogl.debug.GLDrawable -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup=true"
+#
+# See README: JOGL2 Port for JOGL flags
+#
#G_ARGS="+connect 10.1.0.52 +set cl_timeout 12000"
#G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0"
-#G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref joglgl2"
-#G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref jogles1"
-G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref jogles2"
#G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref jogldummy"
+#G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref joglgl2"
+#G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref jogles2"
+G_ARGS="+set s_impl dummy +set timeout 12000 +set cl_timeout 12000 +set gl_mode 0 +set vid_ref jogles1"
+
+# G_ARGS2="+set jogl_gl2 0 +set jogl_gl2es1 1 +set jogl_gl2es2 1 +set jogl_rgb565 1"
+# G_ARGS2="+set gl_texturemode GL_LINEAR_MIPMAP_NEAREST"
+# G_ARGS2="+set r_shadows 0 +set gl_shadows 0 +set gl_dynamic 0"
+# G_ARGS2="+connect 10.1.0.52"
-exec java $X_ARGS -cp $CP $D0_ARGS $D_ARGS jake2.Jake2 $G_ARGS $*
+exec java $X_ARGS -cp $CP $D0_ARGS $D_ARGS jake2.Jake2 $G_ARGS $G_ARGS2 $*
diff --git a/README b/README
index b7d5145..ee01dff 100644
--- a/README
+++ b/README
@@ -7,19 +7,38 @@ distributed under the terms of the GPL (see LICENSE).
The port was done completely in Java. No native libraries are used for the
game functionality. We use the jogl Java OpenGL bindings for graphics rendering
and Java OpenAL (joal) for sound. Since 0.9.4 release, Jake2 comes with an lwjgl driver
-as an alternative for the jogl/joal combination.
+as an alternative for the jogl/joal combination, which has been dropped in the JOGL2 port.
-Jake2 is still under development. Send bug reports and feedback to
+Jake2 is still under development. Send bug reports and feedback to [email protected].
+In regards to the JOGL2 port, please use the JogAmp forum: http://forum.jogamp.org/.
Currently Jake2 supports Linux, Windows2000/XP and Mac OS X. The Jake2 dedicated
server runs on every Java supported plattform.
+The JOGL2 port runs on all platforms supported by JogAmp,
+incl. embedded ARM devices w/ GNU/Linux (Pandaboard, Rasperry Pi, Android devices etc.).
requirements:
400 MHz CPU
Geforce2 MX or better graphics accelerator
-at least JRE 1.4 to run Jake2
-at least JDK 1.5 to build Jake2 from source
+at least JRE 1.6 to run Jake2
+at least [open]JDK 1.6 to build Jake2 from source
+
+JOGL2 Port
+==========
+
+JOGL Renderer can be set via 'vid_ref', i.e. '+set vid_ref jogles2'
+ - jogles1 ES1 renderer, may use GL2ES1 w/ 'jogl_gl2es1 1'
+ - jogles2 ES1 renderer, may use GL2ES2 w/ 'jogl_gl2es2 1'
+ - joglgl2 GL2 renderer, maybe disabled w/ 'jogl_gl2 0'
+ - jogldummy NOP GL renderer to measure performance w/o GL costs
+
+Special GLProfile selection flags:
+ - jogl_gl2 0 disable joglgl2, default enabled '1'
+ - jogl_gl2es1 1 allow desktop GL2ES1 for jogles1 renderer, default disabled '0'
+ - jogl_gl2es2 1 allow desktop GL2ES2 for jogles2 renderer, default disabled '0'
+
+Special drawable surface flags:
+ - jogl_rgb565 1 requesting a RGB565 surface, otherwise request default RGB888 surface
Installation
------------
@@ -53,9 +72,9 @@ Jake2 sources from CVS.
--------------------
Jake2 uses:
-jogl OpenGL bindings https://jogl.dev.java.net
-joal OpenAL bindings https://joal.dev.java.net
-lwjgl Light Weight Java Game Library http://www.lwjgl.org
+jogl OpenGL bindings https://jogamp.org/jogl/
+joal OpenAL bindings https://jogamp.org/joal/
+lwjgl Light Weight Java Game Library http://www.lwjgl.org (removed in JOGL2 port)
openal Audio library http://www.openal.org
izpack Installer http://www.izforge.com/
@@ -64,6 +83,7 @@ ant build tool http://ant.apache.org
xerces XML library http://xml.apache.org
Use <[email protected]> for bug reports and feedback.
+In regards to the JOGL2 port, please use the JogAmp forum: http://forum.jogamp.org/.
have fun!
@@ -76,3 +96,4 @@ Rene Stoeckel <[email protected]>
Contributors
------------
David Sanders lwjgl support
+Sven Gothel JOGL2 port
diff --git a/README_DE b/README_DE
deleted file mode 100644
index bd9e21a..0000000
--- a/README_DE
+++ /dev/null
@@ -1,82 +0,0 @@
-Jake2 README
-============
-
-Jake2 ist eine Java Portierung der Quake2 Engine von id Software. Id Software
-hat den Sourcecode der Quake2 Engine unter den Bedingungen der GPL
-ver�ffentlicht. Dementsprechend wird auch Jake2 unter der GPL (siehe LICENSE)
-lizensiert.
-
-Jake2 ist eine reine Java Anwendung. Als native Library kommen im Moment nur
-jogl f�r die OpenGL Anbindung und joal f�r OpenAudio Soundunterst�tzung zum
-Einsatz. Seit Version 0.9.4 ist auch ein lwjgl Treiber als Alternative zur
-jogl/joal Kombination enthalten. Die komplette Funktionalit�t der Engine wurde
-ausschliesslich mit Java realisiert.
-
-Jake2 befindet sich noch im Entwicklungsstadium. Die Kontaktaddresse f�r
-Bugreports und R�ckmeldungen ist [email protected].
-
-Jake2 l�uft unter Linux, Windows2000/XP sowie Mac OS X. Als reiner Server ohne
-grafische Oberfl�che l�uft Jake2 auf jeder Plattform mit JRE1.4.
-
-Mindestanforderungen:
-400 MHz CPU
-Geforce2 MX oder bessere Grafikkarte
-JRE 1.4.2
-JDK 1.5 zum �bersetzen der Jake2 Quellen
-
-Installation
-------------
-
-ausgehend von der Bin�rdistribution:
-- Installationsprogramm mit "java -jar Jake2-0.9.5-install.jar" starten
-- den Anweisungen folgen
-- ins Installationsverzeichnis wechseln
-- Jake2 mit "jake2.sh" oder "jake2.bat" aus dem Installationsverzeichnis starten
-- um den lwjgl OpenGL/OpenAL Treiber zu nutzen Jake2 mit "jake2_lwjgl.sh" oder
- "jake2_lwjgl.bat" aus dem Installationsverzeichnis starten
-
-ausgehend von Sourcedistribution:
-- jake2src-version.tar.gz oder jake2src-version.zip entpacken
-- JAVA_HOME Umgebungsvariable auf JDK1.5 Installationsverzeichnis setzen
-- "build.sh installer" oder "build.bat installer" erzeugt den Installer
-
-Quake2 Leveldaten installieren:
-- Wenn die Quake2 Leveldaten beim Start von Jake2 nicht gefunden werden,
- besteht die M�glichkeit ein baseq2 Verzeichnis einer bestehenden Quake2
- Installation (Demo oder Vollversion) auszuw�hlen oder die Leveldaten der
- Demo herunterzuladen und zu installieren
-
-Zum Testen neuer und experimenteller Features kann der aktuelle Jake2
-Sourcetree per anonymous CVS ausgecheckt werden.
-- "cvs -d:pserver:[email protected]:/cvsroot/jake2 login"
-- bei der Frage nach dem Passwort einfach Enter dr�cken
-- "cvs -d:pserver:[email protected]:/cvsroot/jake2 co jake2"
-- dann gehts weiter wie oben f�r die Sourcedistribution beschrieben
-
-externe Komponenten
--------------------
-
-Jake2 benutzt:
-jogl OpenGL bindings https://jogl.dev.java.net
-joal OpenAL bindings https://joal.dev.java.net
-lwjgl Light Weight Java Game Library http://www.lwjgl.org
-openal Audio library http://www.openal.org
-izpack Installer http://www.izforge.com/
-
-the source distribution comes with:
-ant build tool http://ant.apache.org
-xerces XML library http://xml.apache.org
-
-<[email protected]> f�r Bugreports und R�ckmeldungen.
-
-have fun!
-
-bytonic Software
-----------------
-Holger Zickner <[email protected]>
-Carsten Weisse <[email protected]>
-Rene Stoeckel <[email protected]>
-
-Contributors
-------------
-David Sanders lwjgl Unterst�tzung
diff --git a/src/jake2/render/JoglES1Renderer.java b/src/jake2/render/JoglES1Renderer.java
index f63a836..7798019 100644
--- a/src/jake2/render/JoglES1Renderer.java
+++ b/src/jake2/render/JoglES1Renderer.java
@@ -29,7 +29,6 @@ import javax.media.nativewindow.util.Dimension;
import jake2.Defines;
import jake2.client.refdef_t;
import jake2.client.refexport_t;
-import jake2.qcommon.Cvar;
import jake2.render.opengl.JoglES1Driver;
import jake2.sys.NEWTKBD;
import jake2.sys.KBD;
@@ -69,8 +68,6 @@ final class JoglES1Renderer extends JoglES1Driver implements refexport_t, Ref {
// init the OpenGL drivers
impl.setGLDriver(this);
- // Cvar.Set("gl_clear", "1"); // FIXME
-
// pre init, reads Cvar's
if (!impl.R_Init(vid_xpos, vid_ypos)) {
return false;
diff --git a/src/jake2/render/JoglES2Renderer.java b/src/jake2/render/JoglES2Renderer.java
index dc836dc..dec8a4a 100644
--- a/src/jake2/render/JoglES2Renderer.java
+++ b/src/jake2/render/JoglES2Renderer.java
@@ -68,8 +68,6 @@ final class JoglES2Renderer extends JoglES2Driver implements refexport_t, Ref {
// init the OpenGL drivers
impl.setGLDriver(this);
- // Cvar.Set("gl_clear", "1"); // FIXME
-
// pre init, reads Cvar's
if (!impl.R_Init(vid_xpos, vid_ypos)) return false;
// activates the OpenGL context
diff --git a/src/jake2/render/JoglGL2Renderer.java b/src/jake2/render/JoglGL2Renderer.java
index 31eb25c..48432d7 100644
--- a/src/jake2/render/JoglGL2Renderer.java
+++ b/src/jake2/render/JoglGL2Renderer.java
@@ -29,7 +29,6 @@ import javax.media.nativewindow.util.Dimension;
import jake2.Defines;
import jake2.client.refdef_t;
import jake2.client.refexport_t;
-import jake2.qcommon.Cvar;
import jake2.render.opengl.JoglGL2Driver;
import jake2.sys.NEWTKBD;
import jake2.sys.KBD;
@@ -69,8 +68,6 @@ final class JoglGL2Renderer extends JoglGL2Driver implements refexport_t, Ref {
// init the OpenGL drivers
impl.setGLDriver(this);
- // Cvar.Set("gl_clear", "1"); // FIXME
-
// pre init, reads Cvar's
if (!impl.R_Init(vid_xpos, vid_ypos)) return false;
// activates the OpenGL context
diff --git a/src/jake2/render/Renderer.java b/src/jake2/render/Renderer.java
index 7b83525..1f29245 100644
--- a/src/jake2/render/Renderer.java
+++ b/src/jake2/render/Renderer.java
@@ -39,7 +39,7 @@ public class Renderer {
static RenderAPI fastRenderer = new jake2.render.fast.Misc();
static RenderAPI basicRenderer = new jake2.render.basic.Misc();
- static Vector drivers = new Vector(3);
+ static Vector<Ref> drivers = new Vector<Ref>(4);
static {
try {
@@ -59,16 +59,16 @@ public class Renderer {
// t.printStackTrace();
}
try {
- Class.forName("javax.media.opengl.GL2ES1");
- Class.forName("jake2.render.JoglES1Renderer");
+ Class.forName("javax.media.opengl.GL2ES2");
+ Class.forName("jake2.render.JoglES2Renderer");
} catch (Throwable t) {
// ignore the new jogl driver if runtime not in classpath
System.err.println("Catched exception: "+t.getMessage());
// t.printStackTrace();
}
try {
- Class.forName("javax.media.opengl.GL2ES2");
- Class.forName("jake2.render.JoglES2Renderer");
+ Class.forName("javax.media.opengl.GL2ES1");
+ Class.forName("jake2.render.JoglES1Renderer");
} catch (Throwable t) {
// ignore the new jogl driver if runtime not in classpath
System.err.println("Catched exception: "+t.getMessage());
@@ -109,7 +109,7 @@ public class Renderer {
Ref driver = null;
int count = drivers.size();
for (int i = 0; i < count; i++) {
- driver = (Ref) drivers.get(i);
+ driver = drivers.get(i);
if (driver.getName().equals(driverName)) {
return driver.GetRefAPI((fast) ? fastRenderer : basicRenderer);
}
@@ -119,13 +119,11 @@ public class Renderer {
}
public static String getDefaultName() {
- return (drivers.isEmpty()) ? null : ((Ref) drivers.firstElement())
- .getName();
+ return (drivers.isEmpty()) ? null : drivers.firstElement().getName();
}
public static String getPreferedName() {
- return (drivers.isEmpty()) ? null : ((Ref) drivers.lastElement())
- .getName();
+ return (drivers.isEmpty()) ? null : drivers.lastElement().getName();
}
public static String[] getDriverNames() {
@@ -136,7 +134,7 @@ public class Renderer {
int count = drivers.size();
String[] names = new String[count];
for (int i = 0; i < count; i++) {
- names[i] = ((Ref) drivers.get(i)).getName();
+ names[i] = drivers.get(i).getName();
}
return names;
}
diff --git a/src/jake2/render/opengl/DummyGL.java b/src/jake2/render/opengl/DummyGL.java
index b7d4c58..b7827e4 100644
--- a/src/jake2/render/opengl/DummyGL.java
+++ b/src/jake2/render/opengl/DummyGL.java
@@ -139,7 +139,7 @@ public class DummyGL implements QGL {
public String glGetString(int name) {
switch (name) {
case GL_EXTENSIONS:
- return "GL_ARB_multitexture";
+ return "GL_ARB_multitexture GL_EXT_point_parameters";
case GL_VERSION:
return "2.0.0 Dummy";
case GL_VENDOR:
diff --git a/src/jake2/render/opengl/JoglES1Driver.java b/src/jake2/render/opengl/JoglES1Driver.java
index be3a9fd..64d3790 100644
--- a/src/jake2/render/opengl/JoglES1Driver.java
+++ b/src/jake2/render/opengl/JoglES1Driver.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,8 +40,16 @@ import com.jogamp.newt.ScreenMode;
*/
public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver {
- // protected static GLProfile glp = GLProfile.get(GLProfile.GLES1); // exception if n/a is desired
- protected static GLProfile glp = GLProfile.get(GLProfile.GL2ES1); // 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_gl2es1", "0", 0);
+ if( v.value != 0f ) {
+ glp = GLProfile.getGL2ES1();
+ } else {
+ glp = GLProfile.get(GLProfile.GLES1);
+ }
+ }
protected JoglES1Driver() {
super(true);
diff --git a/src/jake2/render/opengl/JoglES2Driver.java b/src/jake2/render/opengl/JoglES2Driver.java
index edfe8b2..b6a0a62 100644
--- a/src/jake2/render/opengl/JoglES2Driver.java
+++ b/src/jake2/render/opengl/JoglES2Driver.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;
@@ -40,8 +42,16 @@ import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode;
*/
public abstract class JoglES2Driver extends JoglGL2ES1 implements GLDriver {
- // protected static GLProfile glp = GLProfile.get(GLProfile.GLES2); // exception if n/a is desired
- protected static GLProfile glp = GLProfile.getGL2ES2(); // 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_gl2es2", "0", 0);
+ if( v.value != 0f ) {
+ glp = GLProfile.getGL2ES2();
+ } else {
+ glp = GLProfile.get(GLProfile.GLES2);
+ }
+ }
// protected static final ShaderSelectionMode shaderSelectionMode = ShaderSelectionMode.AUTO;
protected static final ShaderSelectionMode shaderSelectionMode = ShaderSelectionMode.COLOR_TEXTURE2;
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);
diff --git a/src/jake2/render/opengl/JoglGL2ES1.java b/src/jake2/render/opengl/JoglGL2ES1.java
index a183f2f..e560bac 100644
--- a/src/jake2/render/opengl/JoglGL2ES1.java
+++ b/src/jake2/render/opengl/JoglGL2ES1.java
@@ -1,9 +1,10 @@
package jake2.render.opengl;
-
import java.nio.*;
-import javax.media.opengl.*;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GLException;
import com.jogamp.opengl.util.ImmModeSink;
diff --git a/src/jake2/render/opengl/NEWTWin.java b/src/jake2/render/opengl/NEWTWin.java
index 28a6019..d9164dd 100644
--- a/src/jake2/render/opengl/NEWTWin.java
+++ b/src/jake2/render/opengl/NEWTWin.java
@@ -9,12 +9,15 @@ import jake2.Defines;
import jake2.Globals;
import jake2.SizeChangeListener;
import jake2.client.VID;
+import jake2.game.cvar_t;
import jake2.qcommon.Cbuf;
+import jake2.qcommon.Cvar;
import jake2.render.Base;
import jake2.sys.NEWTKBD;
import java.util.List;
+import javax.media.nativewindow.CapabilitiesChooser;
import javax.media.nativewindow.util.Dimension;
import javax.media.nativewindow.util.DimensionImmutable;
import javax.media.nativewindow.util.SurfaceSize;
@@ -32,6 +35,7 @@ import com.jogamp.newt.event.WindowEvent;
import com.jogamp.newt.opengl.GLWindow;
import com.jogamp.newt.util.MonitorMode;
import com.jogamp.newt.util.ScreenModeUtil;
+import com.jogamp.opengl.GenericGLCapabilitiesChooser;
public class NEWTWin {
ScreenMode oldDisplayMode = null;
@@ -117,12 +121,18 @@ public class NEWTWin {
if(null == window) {
final GLCapabilities caps = new GLCapabilities(glp);
- /*** FIXME ..
- caps.setRedBits(5);
- caps.setGreenBits(6);
- caps.setBlueBits(5);
- caps.setAlphaBits(0); */
+ CapabilitiesChooser chooser = null; // default
+ {
+ final cvar_t v = Cvar.Get("jogl_rgb565", "0", 0);
+ if( v.value != 0f ) {
+ caps.setRedBits(5);
+ caps.setGreenBits(6);
+ caps.setBlueBits(5);
+ chooser = new GenericGLCapabilitiesChooser(); // don't trust native GL-TK chooser
+ }
+ }
window = GLWindow.create(screen, caps);
+ window.setCapabilitiesChooser(chooser);
window.setTitle("Jake2 ("+driverName+"-newt-"+glp.getName().toLowerCase()+")");
}