diff options
author | Sven Gothel <[email protected]> | 2012-10-19 17:13:14 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-10-19 17:13:14 +0200 |
commit | 0d353c8bec9cc0c9f3dc6326177f3022c920f677 (patch) | |
tree | 984e3e4bf884142edfd0c3a2b27cf9b66029bcf2 /src/jake2/render/opengl/JoglES1Driver.java | |
parent | 7b18dfedf6c04f77a6032539f8b70d434375d139 (diff) |
Fix/Enhance NEWT ScreenMode (FS) integration, simplify NEWTWin creation
- Only list unique resolutions
- Use List<ScreenMode>
- Properly deactivateGLContext()/activateGLContext() for setMode(..)
Further:
- JoglES2Driver: Claim to have pointExt (FFP emul will follow up)
Diffstat (limited to 'src/jake2/render/opengl/JoglES1Driver.java')
-rw-r--r-- | src/jake2/render/opengl/JoglES1Driver.java | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/jake2/render/opengl/JoglES1Driver.java b/src/jake2/render/opengl/JoglES1Driver.java index 64d3790..790b2d8 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 java.util.List; + import jake2.game.cvar_t; import jake2.qcommon.Cvar; import jake2.qcommon.xcommand_t; @@ -59,7 +61,7 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver { public abstract String getName(); - public ScreenMode[] getModeList() { + public List<ScreenMode> getModeList() { if(null == newtWin) { throw new RuntimeException("NEWTWin not yet initialized."); } @@ -72,7 +74,6 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver { } int res = newtWin.setMode(glp, dim, mode, fullscreen, getName()); if( Base.rserr_ok == res ) { - activate(); setGL(newtWin.window.getGL().getGL2ES1()); init(0, 0); @@ -82,7 +83,6 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver { } public void shutdown() { - deactivate(); if(null != newtWin) { newtWin.shutdown(); } @@ -109,7 +109,7 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver { } public void beginFrame(float camera_separation) { - activate(); + newtWin.activateGLContext(); } public void endFrame() { @@ -137,18 +137,12 @@ public abstract class JoglES1Driver extends JoglGL2ES1 implements GLDriver { callback.execute(); } - protected void activate() { - final GLContext ctx = newtWin.window.getContext(); - if ( null != ctx && GLContext.getCurrent() != ctx ) { - ctx.makeCurrent(); - } + protected final void activateGLContext() { + newtWin.activateGLContext(); } - - protected void deactivate() { - final GLContext ctx = newtWin.window.getContext(); - if ( null != ctx && GLContext.getCurrent() == ctx) { - ctx.release(); - } + + protected final void deactivateGLContext() { + newtWin.activateGLContext(); } // -------------------------------------------------------------------------- |