summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarvey Harrison <[email protected]>2013-02-17 12:34:08 -0800
committerHarvey Harrison <[email protected]>2013-02-17 13:02:00 -0800
commit3923249983f210fc562d8e51b1e6595537a641cf (patch)
treeefd5934a6283e4fc1c825b2377010a98a00882a3 /src
parentb682746d2a68012f5cdf1f57f23981c113ca83e8 (diff)
j3dcore: add new Pipeline method resizeOffscreenLayer
Signed-off-by: Harvey Harrison <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/JoglPipeline.java2
-rw-r--r--src/classes/share/javax/media/j3d/NoopPipeline.java2
-rw-r--r--src/classes/share/javax/media/j3d/Pipeline.java2
-rw-r--r--src/classes/share/javax/media/j3d/Renderer.java40
4 files changed, 23 insertions, 23 deletions
diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java
index 430c970..075f33f 100644
--- a/src/classes/share/javax/media/j3d/JoglPipeline.java
+++ b/src/classes/share/javax/media/j3d/JoglPipeline.java
@@ -7175,6 +7175,8 @@ private boolean hasFBObjectSizeChanged(JoglDrawable jdraw, int width, int height
return (width != fboBack.getWidth() || height != fboBack.getHeight());
}
+ void resizeOffscreenLayer(Canvas3D cv, int width, int height) {}
+
// The native method for setting the Viewport.
void setViewport(Context ctx, int x, int y, int width, int height) {
if (VERBOSE) System.err.println("JoglPipeline.setViewport()");
diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java
index 4c0011c..2e92bfe 100644
--- a/src/classes/share/javax/media/j3d/NoopPipeline.java
+++ b/src/classes/share/javax/media/j3d/NoopPipeline.java
@@ -1144,6 +1144,8 @@ void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) {}
void setProjectionMatrix(Context ctx, double[] projMatrix) {
}
+ void resizeOffscreenLayer(Canvas3D cv, int width, int height) {}
+
// The native method for setting the Viewport.
void setViewport(Context ctx, int x, int y, int width, int height) {
}
diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java
index baa2c12..77da91d 100644
--- a/src/classes/share/javax/media/j3d/Pipeline.java
+++ b/src/classes/share/javax/media/j3d/Pipeline.java
@@ -1095,6 +1095,8 @@ public Pipeline run() {
// The native method for setting the Projection matrix.
abstract void setProjectionMatrix(Context ctx, double[] projMatrix);
+ abstract void resizeOffscreenLayer(Canvas3D cv, int width, int height);
+
// The native method for setting the Viewport.
abstract void setViewport(Context ctx, int x, int y, int width, int height);
diff --git a/src/classes/share/javax/media/j3d/Renderer.java b/src/classes/share/javax/media/j3d/Renderer.java
index 1e1f0d1..6bd08d5 100644
--- a/src/classes/share/javax/media/j3d/Renderer.java
+++ b/src/classes/share/javax/media/j3d/Renderer.java
@@ -983,12 +983,11 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
break doneRender;
}
- // setup viewport
- canvas.setViewport(canvas.ctx, 0, 0,
- cvCache.getCanvasWidth(),
- cvCache.getCanvasHeight());
-
-
+ int cvWidth = cvCache.getCanvasWidth();
+ int cvHeight = cvCache.getCanvasHeight();
+ Pipeline.getPipeline().resizeOffscreenLayer(canvas, cvWidth, cvHeight);
+ // setup viewport
+ canvas.setViewport(canvas.ctx, 0, 0, cvWidth, cvHeight);
// rebuild the display list of all dirty renderMolecules.
if (canvas.useSharedCtx) {
@@ -1133,19 +1132,14 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
Canvas3D.FIELD_ALL,
canvas.useDoubleBuffer);
- // this is if the background image resizes with the canvas
- int winWidth = cvCache.getCanvasWidth();
- int winHeight = cvCache.getCanvasHeight();
-
+ // clear background if not full screen antialiasing
+ // and not in stereo mode
+ if (!doAccum && !sharedStereoZBuffer) {
+ BackgroundRetained bg = renderBin.background;
- // clear background if not full screen antialiasing
- // and not in stereo mode
- if (!doAccum && !sharedStereoZBuffer) {
- BackgroundRetained bg = renderBin.background;
+ canvas.clear(bg, cvWidth, cvHeight);
- canvas.clear(bg, winWidth, winHeight);
-
- }
+ }
// handle preRender callback
if (VirtualUniverse.mc.doDsiRenderLock) {
@@ -1236,14 +1230,14 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
}
}
- // clear background for stereo and
- // accumulation buffer cases
- if (doAccum || sharedStereoZBuffer) {
- BackgroundRetained bg = renderBin.background;
+ // clear background for stereo and
+ // accumulation buffer cases
+ if (doAccum || sharedStereoZBuffer) {
+ BackgroundRetained bg = renderBin.background;
- canvas.clear(bg, winWidth, winHeight);
+ canvas.clear(bg, cvWidth, cvHeight);
- }
+ }
// render background geometry
if (renderBin.geometryBackground != null) {