diff options
author | Sven Gothel <[email protected]> | 2012-10-12 15:18:30 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-12 15:18:30 +0200 |
commit | 04d63492cdb87d49e0f10b8f8744193755e344f7 (patch) | |
tree | 1afb8ae81a23aa3265ece2784621d737ea89895a /src/jake2/render/opengl/JoglES2Driver.java | |
parent | f5612e7dfc635359f15b402c2ee9022a5e703a9d (diff) |
Enabling GL2ES1 and GL2ES2 driver, using JOGL's ImmModeSink and FixedFunctionPipeline to complete each profilejogl2_es2
GL2ES1 uses ImmModeSink
GL2ES2 uses ImmModeSink and FixedFunctionPipeline
TODO: Updated JOGL contained binaries w/ next aggregated build (please use the source until then)
Diffstat (limited to 'src/jake2/render/opengl/JoglES2Driver.java')
-rw-r--r-- | src/jake2/render/opengl/JoglES2Driver.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/jake2/render/opengl/JoglES2Driver.java b/src/jake2/render/opengl/JoglES2Driver.java index 7319324..e6dc90a 100644 --- a/src/jake2/render/opengl/JoglES2Driver.java +++ b/src/jake2/render/opengl/JoglES2Driver.java @@ -32,18 +32,28 @@ import javax.media.nativewindow.util.Dimension; import javax.media.opengl.*; import com.jogamp.newt.ScreenMode; +import com.jogamp.opengl.util.glsl.fixedfunc.FixedFuncUtil; +import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode; /** * JoglCommon */ -public abstract class JoglES2Driver extends JoglES2 implements GLDriver { +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 ShaderSelectionMode shaderSelectionMode = ShaderSelectionMode.AUTO; + protected static final ShaderSelectionMode shaderSelectionMode = ShaderSelectionMode.COLOR_TEXTURE; + protected JoglES2Driver() { // singleton } private NEWTWin newtWin = null; + public abstract String getName(); + public ScreenMode[] getModeList() { if(null == newtWin) { throw new RuntimeException("NEWTWin not yet initialized."); @@ -55,10 +65,10 @@ public abstract class JoglES2Driver extends JoglES2 implements GLDriver { if(null == newtWin) { newtWin = new NEWTWin(); } - int res = newtWin.setMode(dim, mode, fullscreen); + int res = newtWin.setMode(glp, dim, mode, fullscreen, getName()); if( Base.rserr_ok == res ) { - - setGL(newtWin.window.getGL().getGL2()); + activate(); + setGL( FixedFuncUtil.wrapFixedFuncEmul(newtWin.window.getGL(), shaderSelectionMode, null, true, false) ); init(0, 0); return Base.rserr_ok; @@ -97,11 +107,11 @@ public abstract class JoglES2Driver extends JoglES2 implements GLDriver { } public void endFrame() { + newtWin.window.swapBuffers(); final GLContext ctx = newtWin.window.getContext(); if ( null != ctx && GLContext.getCurrent() == ctx) { ctx.release(); } - newtWin.window.swapBuffers(); newtWin.fpsCounter.tickFPS(); } |