diff options
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(); } |