aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render/fast/Main.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-06-28 19:06:14 +0200
committerSven Gothel <[email protected]>2013-06-28 19:06:14 +0200
commit54bbd1a726e73841f0bd4cc79e5b12e83a88ba18 (patch)
tree6e71430ad8217e1fce810b5310ec0b5b2766340c /src/jake2/render/fast/Main.java
parent28ed823b1a804145b4dd741807a83570abc139e1 (diff)
Add Applet Feature incl. required fixes.
- Jake2Applet - Reenable JavaScript Bridge to resize Applet - Pass through 4:3 aspect custom video mode (Jake2 args) - Pass through applet parameter 'jake_args' (Jake2 args) - OSX Hack: Re-create Game at init, otherwise flickering appears (??) - Fix VID.init: Set vid_ref.modifier = true, otherwise not guaranteed VID creation - BeginFrame, R_BeginFrame, beginFrame, activateGLContext: Return 'true', if ctx is available, otherwise false to skip frame. - NEWTWin: - Applet mode (in Applet container): Always release GL ctx - Use GLAnimatorControl impl, to state whether we are animating or not and to tell us, whether we have to release the GL ctx. - Add HOME -> Reparent feature for Applets - Workaround for NEWT/Windows Bug 798 - NEWT Key Handling: - Ignore auto-repeat - Workaround for NEWT/Windows Bug 798 - Add HTML page - normal - debug mode
Diffstat (limited to 'src/jake2/render/fast/Main.java')
-rw-r--r--src/jake2/render/fast/Main.java118
1 files changed, 61 insertions, 57 deletions
diff --git a/src/jake2/render/fast/Main.java b/src/jake2/render/fast/Main.java
index 5459f20..13a31b3 100644
--- a/src/jake2/render/fast/Main.java
+++ b/src/jake2/render/fast/Main.java
@@ -1312,7 +1312,7 @@ public abstract class Main extends Base {
/**
* R_BeginFrame
*/
- public void R_BeginFrame(float camera_separation) {
+ public boolean R_BeginFrame(float camera_separation) {
vid.update();
@@ -1363,64 +1363,68 @@ public abstract class Main extends Base {
}
}
- glImpl.beginFrame(camera_separation);
-
- /*
- ** go into 2D mode
- */
- gl.glViewport(0, 0, vid.getWidth(), vid.getHeight());
- gl.glMatrixMode(GL_PROJECTION);
- gl.glLoadIdentity();
- gl.glOrtho(0, vid.getWidth(), vid.getHeight(), 0, -99999, 99999);
- gl.glMatrixMode(GL_MODELVIEW);
- gl.glLoadIdentity();
- gl.glDisable(GL_DEPTH_TEST);
- gl.glDisable(GL_CULL_FACE);
- gl.glDisable(GL_BLEND);
- gl.glEnable(GL_ALPHA_TEST);
- gl.glColor4f(1, 1, 1, 1);
-
- /*
- ** draw buffer stuff
- */
- if (gl_drawbuffer.modified) {
- gl_drawbuffer.modified = false;
-
- if (gl_state.camera_separation == 0 || !gl_state.stereo_enabled) {
- if (gl_drawbuffer.string.equalsIgnoreCase("GL_FRONT"))
- gl.glDrawBuffer(GL_FRONT);
- else
- gl.glDrawBuffer(GL_BACK);
+ if( glImpl.beginFrame(camera_separation) ) {
+ /*
+ ** go into 2D mode
+ */
+ gl.glViewport(0, 0, vid.getWidth(), vid.getHeight());
+ gl.glMatrixMode(GL_PROJECTION);
+ gl.glLoadIdentity();
+ gl.glOrtho(0, vid.getWidth(), vid.getHeight(), 0, -99999, 99999);
+ gl.glMatrixMode(GL_MODELVIEW);
+ gl.glLoadIdentity();
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glDisable(GL_CULL_FACE);
+ gl.glDisable(GL_BLEND);
+ gl.glEnable(GL_ALPHA_TEST);
+ gl.glColor4f(1, 1, 1, 1);
+
+ /*
+ ** draw buffer stuff
+ */
+ if (gl_drawbuffer.modified) {
+ gl_drawbuffer.modified = false;
+
+ if (gl_state.camera_separation == 0 || !gl_state.stereo_enabled) {
+ if (gl_drawbuffer.string.equalsIgnoreCase("GL_FRONT"))
+ gl.glDrawBuffer(GL_FRONT);
+ else
+ gl.glDrawBuffer(GL_BACK);
+ }
}
+
+ /*
+ ** texturemode stuff
+ */
+ if (gl_texturemode.modified) {
+ GL_TextureMode(gl_texturemode.string);
+ gl_texturemode.modified = false;
+ }
+
+ if (gl_texturealphamode.modified) {
+ GL_TextureAlphaMode(gl_texturealphamode.string);
+ gl_texturealphamode.modified = false;
+ }
+
+ if (gl_texturesolidmode.modified) {
+ GL_TextureSolidMode(gl_texturesolidmode.string);
+ gl_texturesolidmode.modified = false;
+ }
+
+ /*
+ ** swapinterval stuff
+ */
+ GL_UpdateSwapInterval();
+
+ //
+ // clear screen if desired
+ //
+ R_Clear();
+
+ return true;
+ } else {
+ return true;
}
-
- /*
- ** texturemode stuff
- */
- if (gl_texturemode.modified) {
- GL_TextureMode(gl_texturemode.string);
- gl_texturemode.modified = false;
- }
-
- if (gl_texturealphamode.modified) {
- GL_TextureAlphaMode(gl_texturealphamode.string);
- gl_texturealphamode.modified = false;
- }
-
- if (gl_texturesolidmode.modified) {
- GL_TextureSolidMode(gl_texturesolidmode.string);
- gl_texturesolidmode.modified = false;
- }
-
- /*
- ** swapinterval stuff
- */
- GL_UpdateSwapInterval();
-
- //
- // clear screen if desired
- //
- R_Clear();
}
int[] r_rawpalette = new int[256];