summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/classes/share/javax/media/j3d/Canvas3D.java64
-rw-r--r--src/classes/share/javax/media/j3d/JoglPipeline.java13
-rw-r--r--src/classes/share/javax/media/j3d/NoopPipeline.java4
-rw-r--r--src/classes/share/javax/media/j3d/Pipeline.java2
-rw-r--r--src/classes/share/javax/media/j3d/Renderer.java2
5 files changed, 20 insertions, 65 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java
index c8aaa87..e709c2a 100644
--- a/src/classes/share/javax/media/j3d/Canvas3D.java
+++ b/src/classes/share/javax/media/j3d/Canvas3D.java
@@ -342,13 +342,6 @@ public class Canvas3D extends Canvas {
static final int VIEW_MATRIX_DIRTY = 0x8000;
// static final int SHADER_DIRTY = 0x10000; Not ready for this yet -- JADA
- // Use to notify D3D Canvas when window change
- static final int RESIZE = 1;
- static final int TOGGLEFULLSCREEN = 2;
- static final int NOCHANGE = 0;
- static final int RESETSURFACE = 1;
- static final int RECREATEDDRAW = 2;
-
//
// Flag that indicates whether this Canvas3D is an off-screen Canvas3D
//
@@ -3838,49 +3831,17 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
texUnitState[texUnitIndex].texture = null;
}
-
- // use by D3D only
- void resetTextureBin() {
- TextureRetained tex;
-
- // We don't use rdr.objectId for background texture in D3D
- // so there is no need to handle rdr.objectId
- if ((graphics2D != null) &&
- (graphics2D.objectId != -1)) {
- VirtualUniverse.mc.freeTexture2DId(graphics2D.objectId);
- // let J3DGraphics2DImpl to initialize texture again
- graphics2D.objectId = -1;
- }
-
- for (int id = textureIDResourceTable.size() - 1; id >= 0; id--) {
- tex = textureIDResourceTable.get(id);
- if (tex != null) {
- tex.resourceCreationMask &= ~canvasBit;
-
- }
- }
- }
-
- // reset all attributes so that everything e.g. display list,
- // texture will recreate again in the next frame
- void resetRendering(int status) {
-
- if (status == RECREATEDDRAW) {
- // D3D use MANAGE_POOL when createTexture, so there
- // is no need to download texture again in case of RESETSURFACE
- resetTextureBin();
- screen.renderer.needToResendTextureDown = true;
- }
-
+// reset all attributes so that everything e.g. display list,
+// texture will recreate again in the next frame
+void resetRendering() {
reset();
- synchronized (dirtyMaskLock) {
- cvDirtyMask[0] |= VIEW_INFO_DIRTY;
- cvDirtyMask[1] |= VIEW_INFO_DIRTY;
- }
-
- }
+ synchronized (dirtyMaskLock) {
+ cvDirtyMask[0] |= VIEW_INFO_DIRTY;
+ cvDirtyMask[1] |= VIEW_INFO_DIRTY;
+ }
+}
void reset() {
int i;
@@ -3967,7 +3928,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
}
- void resetImmediateRendering(int status) {
+void resetImmediateRendering() {
canvasDirty = 0xffff;
ra = null;
@@ -3992,7 +3953,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
1.0f, 1.0f,
1.0f, 1.0f, false);
updateMaterial(ctx, 1.0f, 1.0f, 1.0f, 1.0f);
- resetRendering(NOCHANGE);
+ resetRendering();
makeCtxCurrent();
synchronized (dirtyMaskLock) {
cvDirtyMask[0] |= VIEW_INFO_DIRTY;
@@ -4001,10 +3962,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
needToRebuildDisplayList = true;
ctxTimeStamp = VirtualUniverse.mc.getContextTimeStamp();
- if (status == RECREATEDDRAW) {
- screen.renderer.needToResendTextureDown = true;
- }
- }
+}
// overide Canvas.getSize()
diff --git a/src/classes/share/javax/media/j3d/JoglPipeline.java b/src/classes/share/javax/media/j3d/JoglPipeline.java
index 6d71b2c..4a5df2c 100644
--- a/src/classes/share/javax/media/j3d/JoglPipeline.java
+++ b/src/classes/share/javax/media/j3d/JoglPipeline.java
@@ -6422,13 +6422,12 @@ class JoglPipeline extends Pipeline {
}
}
- // The native method for swapBuffers
- int swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) {
- if (VERBOSE) System.err.println("JoglPipeline.swapBuffers()");
- GLDrawable draw = drawable(drawable);
- draw.swapBuffers();
- return Canvas3D.NOCHANGE;
- }
+// The native method for swapBuffers
+void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) {
+ if (VERBOSE) System.err.println("JoglPipeline.swapBuffers()");
+ GLDrawable draw = drawable(drawable);
+ draw.swapBuffers();
+}
// native method for setting Material when no material is present
void updateMaterialColor(Context ctx, float r, float g, float b, float a) {
diff --git a/src/classes/share/javax/media/j3d/NoopPipeline.java b/src/classes/share/javax/media/j3d/NoopPipeline.java
index 1eb78dc..7fa9659 100644
--- a/src/classes/share/javax/media/j3d/NoopPipeline.java
+++ b/src/classes/share/javax/media/j3d/NoopPipeline.java
@@ -964,9 +964,7 @@ class NoopPipeline extends Pipeline {
}
// The native method for swapBuffers
-int swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) {
- return Canvas3D.NOCHANGE;
-}
+void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable) {}
// native method for setting Material when no material is present
void updateMaterialColor(Context ctx, float r, float g, float b, float a) {
diff --git a/src/classes/share/javax/media/j3d/Pipeline.java b/src/classes/share/javax/media/j3d/Pipeline.java
index 98d237d..5caaf1e 100644
--- a/src/classes/share/javax/media/j3d/Pipeline.java
+++ b/src/classes/share/javax/media/j3d/Pipeline.java
@@ -957,7 +957,7 @@ public Pipeline run() {
abstract void readOffScreenBuffer(Canvas3D cv, Context ctx, int format, int type, Object data, int width, int height);
// The native method for swapBuffers
- abstract int swapBuffers(Canvas3D cv, Context ctx, Drawable drawable);
+ abstract void swapBuffers(Canvas3D cv, Context ctx, Drawable drawable);
// native method for setting Material when no material is present
abstract void updateMaterialColor(Context ctx, float r, float g, float b, float a);
diff --git a/src/classes/share/javax/media/j3d/Renderer.java b/src/classes/share/javax/media/j3d/Renderer.java
index c4bab5b..a74cdb8 100644
--- a/src/classes/share/javax/media/j3d/Renderer.java
+++ b/src/classes/share/javax/media/j3d/Renderer.java
@@ -933,7 +933,7 @@ ArrayList<TextureRetained> textureIDResourceTable = new ArrayList<TextureRetaine
canvas.createTexUnitState();
}
- canvas.resetImmediateRendering(Canvas3D.NOCHANGE);
+ canvas.resetImmediateRendering();
canvas.drawingSurfaceObject.contextValidated();
if (!canvas.useSharedCtx) {