aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render/opengl/JoglDummyDriver.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-10-19 17:13:14 +0200
committerSven Gothel <[email protected]>2012-10-19 17:13:14 +0200
commit0d353c8bec9cc0c9f3dc6326177f3022c920f677 (patch)
tree984e3e4bf884142edfd0c3a2b27cf9b66029bcf2 /src/jake2/render/opengl/JoglDummyDriver.java
parent7b18dfedf6c04f77a6032539f8b70d434375d139 (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/JoglDummyDriver.java')
-rw-r--r--src/jake2/render/opengl/JoglDummyDriver.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/jake2/render/opengl/JoglDummyDriver.java b/src/jake2/render/opengl/JoglDummyDriver.java
index fb41bf7..3316f2a 100644
--- a/src/jake2/render/opengl/JoglDummyDriver.java
+++ b/src/jake2/render/opengl/JoglDummyDriver.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.qcommon.xcommand_t;
import jake2.render.Base;
@@ -49,7 +51,7 @@ public abstract class JoglDummyDriver extends DummyGL implements GLDriver {
public abstract String getName();
- public ScreenMode[] getModeList() {
+ public List<ScreenMode> getModeList() {
if(null == newtWin) {
throw new RuntimeException("NEWTWin not yet initialized.");
}
@@ -62,7 +64,6 @@ public abstract class JoglDummyDriver extends DummyGL implements GLDriver {
}
int res = newtWin.setMode(glp, dim, mode, fullscreen, getName());
if( Base.rserr_ok == res ) {
- activate();
init(0, 0);
return Base.rserr_ok;
@@ -71,7 +72,6 @@ public abstract class JoglDummyDriver extends DummyGL implements GLDriver {
}
public void shutdown() {
- deactivate();
if(null != newtWin) {
newtWin.shutdown();
}
@@ -98,7 +98,7 @@ public abstract class JoglDummyDriver extends DummyGL implements GLDriver {
}
public void beginFrame(float camera_separation) {
- activate();
+ activateGLContext();
}
public void endFrame() {
@@ -126,18 +126,12 @@ public abstract class JoglDummyDriver extends DummyGL 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();
}
// --------------------------------------------------------------------------