From 4c41dbb44670b0420e5f804911e1f729662598b7 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 19 Oct 2012 10:11:59 +0200 Subject: 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 --- src/jake2/render/opengl/NEWTWin.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/jake2/render/opengl/NEWTWin.java') 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()+")"); } -- cgit v1.2.3