summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2007-03-27 05:38:51 +0000
committerKenneth Russel <[email protected]>2007-03-27 05:38:51 +0000
commitf82d0109c09ad885c1a7cdaed5b99e69188a30ed (patch)
treefdcd71b43156a295c24848e584432a1ca412c66a /src
parent2b5f8985ffa58b0d7f70eaed80ace49425c9da4d (diff)
Added a markDirty() method to TextureRenderer and removed the sync()
method. markDirty() may be called at an arbitrary point (in particular, when no OpenGL context is current) and the union of the dirty regions is automatically synced with the underlying texture during the next getTexture() operation, at which point the dirty region is cleared. Adjusted Overlay and TextRenderer classes. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@210 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4
Diffstat (limited to 'src')
-rwxr-xr-xsrc/demos/j2d/TestOverlay.java4
-rwxr-xr-xsrc/demos/j2d/TestTextureRenderer.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/demos/j2d/TestOverlay.java b/src/demos/j2d/TestOverlay.java
index adc8ba7..b0bcae2 100755
--- a/src/demos/j2d/TestOverlay.java
+++ b/src/demos/j2d/TestOverlay.java
@@ -145,7 +145,7 @@ public class TestOverlay implements GLEventListener {
g2d.fillRect(x + fpsBounds.x, y + fpsBounds.y, fpsBounds.width, fpsBounds.height);
g2d.setColor(Color.WHITE);
g2d.drawString(fpsString, x, y);
- overlay.sync(x + fpsBounds.x, y + fpsBounds.y, fpsBounds.width, fpsBounds.height);
+ overlay.markDirty(x + fpsBounds.x, y + fpsBounds.y, fpsBounds.width, fpsBounds.height);
}
time.update();
@@ -191,7 +191,7 @@ public class TestOverlay implements GLEventListener {
union.add(lastTextBounds);
}
// Put a little slop around this text due to apparent rounding errors
- overlay.sync(union.x, union.y, union.width + 10, union.height + 10);
+ overlay.markDirty(union.x, union.y, union.width + 10, union.height + 10);
// Move down the text bounds
lastTextBounds = textBounds;
diff --git a/src/demos/j2d/TestTextureRenderer.java b/src/demos/j2d/TestTextureRenderer.java
index 596115e..5702743 100755
--- a/src/demos/j2d/TestTextureRenderer.java
+++ b/src/demos/j2d/TestTextureRenderer.java
@@ -126,7 +126,7 @@ public class TestTextureRenderer implements GLEventListener {
g2d.setColor(Color.WHITE);
g2d.drawString(TEST_STRING, 10, 50);
textBounds = gv.getPixelBounds(frc, 10, 50);
- renderer.sync(textBounds.x, textBounds.y, textBounds.width, textBounds.height);
+ renderer.markDirty(textBounds.x, textBounds.y, textBounds.width, textBounds.height);
}
public void display(GLAutoDrawable drawable) {
@@ -151,7 +151,7 @@ public class TestTextureRenderer implements GLEventListener {
g2d.fillRect(fpsBounds.x, fpsBounds.y, fpsBounds.width, fpsBounds.height);
g2d.setColor(Color.WHITE);
g2d.drawString(fpsString, 10, 100);
- renderer.sync(fpsBounds.x, fpsBounds.y, fpsBounds.width, fpsBounds.height);
+ renderer.markDirty(fpsBounds.x, fpsBounds.y, fpsBounds.width, fpsBounds.height);
}
time.update();