aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render/opengl/NEWTWin.java
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 /src/jake2/render/opengl/NEWTWin.java
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
Diffstat (limited to 'src/jake2/render/opengl/NEWTWin.java')
-rw-r--r--src/jake2/render/opengl/NEWTWin.java20
1 files changed, 15 insertions, 5 deletions
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()+")");
}